home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1993 / Internet Info CD-ROM (Walnut Creek) (1993).iso / networking / mail / elm / elm2.4.p23c < prev    next >
Encoding:
Text File  |  1993-08-23  |  97.1 KB  |  3,210 lines

  1. Subject: BETA TEST 2 of elm 2.4 Patch #23c
  2. Summary: This is an official patch for elm 2.4 system.  Please apply it.
  3. Priority: HIGH
  4.  
  5. THIS IS PART 3 OF A 4 PART PATCH
  6.  
  7. THIS PATCH IS IN BETA TEST.  IT IS SUBJECT TO CHANGE.
  8. SAVE YOUR ORIGINAL COPY OF ELM SOURCES SO YOU CAN BACK THIS OUT BEFORE 
  9. APPLYING THE OFFICIAL PATCH
  10.  
  11. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your elm source
  12.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  13.     If you don't have the patch program, apply the following by hand,
  14.     or get patch (version 2.0, latest patchlevel).
  15.  
  16.     After patching:
  17.         Apply patches 23d next
  18.  
  19.     If patch indicates that patchlevel is the wrong version, you may need
  20.     to apply one or more previous patches, or the patch may already
  21.     have been applied.  See the patchlevel.h file to find out what has or
  22.     has not been applied.  In any event, don't continue with the patch.
  23.  
  24.     If you are missing previous patches they can be obtained from our:
  25.     archive server.
  26.  
  27.     Syd Weinstein
  28.     elm@DSI.COM
  29.  
  30.     The patches are available from the dsinc archive server
  31.     Send the following message to archive-server@DSI.COM for
  32.     a list of available patches:
  33.  
  34.     Subject: patch list
  35.     send index elm
  36.  
  37. Index: lib/parsarpwho.c
  38. Prereq: 5.3
  39. *** ../elm2.4/lib/parsarpwho.c    Tue Jan 19 00:07:19 1993
  40. --- lib/parsarpwho.c    Mon Jul 19 22:06:41 1993
  41. ***************
  42. *** 1,8 ****
  43.   
  44. ! static char rcsid[] = "@(#)$Id: parsarpwho.c,v 5.3 1993/01/19 05:07:05 syd Exp $";
  45.   
  46.   /*******************************************************************************
  47. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  48.    *
  49.    *            Copyright (c) 1988-1992 USENET Community Trust
  50.    *            Copyright (c) 1986,1987 Dave Taylor
  51. --- 1,8 ----
  52.   
  53. ! static char rcsid[] = "@(#)$Id: parsarpwho.c,v 5.4 1993/07/20 02:06:13 syd Exp $";
  54.   
  55.   /*******************************************************************************
  56. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  57.    *
  58.    *            Copyright (c) 1988-1992 USENET Community Trust
  59.    *            Copyright (c) 1986,1987 Dave Taylor
  60. ***************
  61. *** 14,19 ****
  62. --- 14,23 ----
  63.    *
  64.    *******************************************************************************
  65.    * $Log: parsarpwho.c,v $
  66. +  * Revision 5.4  1993/07/20  02:06:13  syd
  67. +  * Changes for vms problem
  68. +  * From: M.รก Anio
  69. +  *
  70.    * Revision 5.3  1993/01/19  05:07:05  syd
  71.    * Trim erroreous extra log entry
  72.    * From: Syd
  73. ***************
  74. *** 49,54 ****
  75. --- 53,60 ----
  76.           or  From: hplabs!dat (Dave Taylor)
  77.   
  78.           Added: removes quotes if name is quoted (12/12)
  79. +          HOWEVER:  From: "NAME \"VMS USER\"" <USER@VMS>
  80. +                must be handled delicately !
  81.           Added: only copies STRING characters...
  82.           Added: if no comment part, copy address instead! 
  83.           Added: if is_really_a_to, this is really a 'to' line
  84. ***************
  85. *** 119,134 ****
  86.         
  87.       if (strlen(temp) > 0) {        /* mess with buffer... */
  88.   
  89. !       /* remove leading spaces and quotes... */
  90.   
  91. !       while (whitespace(temp[0]) || temp[0] == '"')
  92.           temp = (char *) (temp + 1);        /* increment address! */
  93.   
  94. !       /* remove trailing spaces and quotes... */
  95.   
  96.         i = strlen(temp) - 1;
  97.   
  98. !       while (i >= 0 && (whitespace(temp[i]) || temp[i] == '"'))
  99.          temp[i--] = '\0';
  100.   
  101.         /* if anything is left, let's change 'from' value! */
  102. --- 125,150 ----
  103.         
  104.       if (strlen(temp) > 0) {        /* mess with buffer... */
  105.   
  106. !       /* remove leading spaces and ONE quote... */
  107.   
  108. !       while (whitespace(temp[0]))
  109. !         temp = (char *) (temp + 1);        /* increment address! */
  110. !       if (temp[0] == '"')
  111. !         temp = (char *) (temp + 1);        /* increment address! */
  112. !       while (whitespace(temp[0]))
  113.           temp = (char *) (temp + 1);        /* increment address! */
  114.   
  115. !       /* remove trailing spaces and ONE quote... */
  116.   
  117.         i = strlen(temp) - 1;
  118.   
  119. !       while (i >= 0 && (whitespace(temp[i])))
  120. !        temp[i--] = '\0';
  121. !       /* Can delete ONE trailing quote, NOT THEM ALL!
  122. !          Assuming the incoming quotes were all right.. [mea@utu.fi] */
  123. !       if (i >= 0 && temp[i] == '"')
  124. !        temp[i--] = '\0';
  125. !       while (i >= 0 && (whitespace(temp[i])))
  126.          temp[i--] = '\0';
  127.   
  128.         /* if anything is left, let's change 'from' value! */
  129.  
  130. Index: lib/posixsig.c
  131. Prereq: 5.6
  132. *** ../elm2.4/lib/posixsig.c    Tue Apr 20 21:16:46 1993
  133. --- lib/posixsig.c    Sun Aug 22 22:46:55 1993
  134. ***************
  135. *** 1,8 ****
  136.   
  137. ! static char rcsid[] = "@(#)$Id: posixsig.c,v 5.6 1993/04/21 01:16:45 syd Exp $";
  138.   
  139.   /*******************************************************************************
  140. !  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
  141.    *
  142.    *            Copyright (c) 1988-1992 USENET Community Trust
  143.    *            Copyright (c) 1986,1987 Dave Taylor
  144. --- 1,8 ----
  145.   
  146. ! static char rcsid[] = "@(#)$Id: posixsig.c,v 5.8 1993/08/23 02:46:51 syd Exp $";
  147.   
  148.   /*******************************************************************************
  149. !  *  The Elm Mail System  -  $Revision: 5.8 $   $State: Exp $
  150.    *
  151.    *            Copyright (c) 1988-1992 USENET Community Trust
  152.    *            Copyright (c) 1986,1987 Dave Taylor
  153. ***************
  154. *** 14,19 ****
  155. --- 14,27 ----
  156.    *
  157.    *******************************************************************************
  158.    * $Log: posixsig.c,v $
  159. +  * Revision 5.8  1993/08/23  02:46:51  syd
  160. +  * Test ANSI_C, not __STDC__ (which is not set on e.g. AIX).
  161. +  * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
  162. +  *
  163. +  * Revision 5.7  1993/08/03  20:14:49  syd
  164. +  * Fix where some systems name SIG_ERR BADSIG
  165. +  * From: Syd
  166. +  *
  167.    * Revision 5.6  1993/04/21  01:16:45  syd
  168.    * SunOS 4.1.3 uses the BSD convention for signal handling in system
  169.    * calls like read. The system call resumes when the signal handler
  170. ***************
  171. *** 51,61 ****
  172.   #include "headers.h"
  173.   
  174.   #ifdef POSIX_SIGNALS
  175.   /*
  176.    * This routine used to duplicate the old signal() calls
  177.    */
  178.   SIGHAND_TYPE
  179. ! #if (defined(__STDC__) && !defined(apollo))
  180.   (*posix_signal(signo, fun))(int)
  181.       int signo;
  182.       SIGHAND_TYPE (*fun)(int);
  183. --- 59,78 ----
  184.   #include "headers.h"
  185.   
  186.   #ifdef POSIX_SIGNALS
  187. + #ifndef SIG_ERR
  188. + #  ifdef BADSIG
  189. + #    define SIG_ERR BADSIG
  190. + #  else
  191. + #    define SIG_ERR -1
  192. + #  endif /* BADSIG */
  193. + #endif /* SIG_ERRR */
  194.   /*
  195.    * This routine used to duplicate the old signal() calls
  196.    */
  197.   SIGHAND_TYPE
  198. ! #if ANSI_C && !defined(apollo)
  199.   (*posix_signal(signo, fun))(int)
  200.       int signo;
  201.       SIGHAND_TYPE (*fun)(int);
  202.  
  203. Index: lib/qstrings.c
  204. Prereq: 5.1
  205. *** ../elm2.4/lib/qstrings.c    Sat Oct  3 18:42:28 1992
  206. --- lib/qstrings.c    Tue Aug  3 15:28:56 1993
  207. ***************
  208. *** 1,8 ****
  209.   
  210. ! static char rcsid[] = "@(#)$Id: qstrings.c,v 5.1 1992/10/03 22:41:36 syd Exp $";
  211.   
  212.   /*******************************************************************************
  213. !  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  214.    *
  215.    *             Copyright (c) 1988-1992 USENET Community Trust
  216.    *             Copyright (c) 1986,1987 Dave Taylor
  217. --- 1,8 ----
  218.   
  219. ! static char rcsid[] = "@(#)$Id: qstrings.c,v 5.2 1993/08/03 19:28:39 syd Exp $";
  220.   
  221.   /*******************************************************************************
  222. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  223.    *
  224.    *             Copyright (c) 1988-1992 USENET Community Trust
  225.    *             Copyright (c) 1986,1987 Dave Taylor
  226. ***************
  227. *** 14,19 ****
  228. --- 14,31 ----
  229.    *
  230.    *******************************************************************************
  231.    * $Log: qstrings.c,v $
  232. +  * Revision 5.2  1993/08/03  19:28:39  syd
  233. +  * Elm tries to replace the system toupper() and tolower() on current
  234. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  235. +  * collide during linking with routines in isctype.o.  This patch adds
  236. +  * a Configure test to determine whether replacements are really needed
  237. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  238. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  239. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  240. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  241. +  * were dropped.
  242. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  243. +  *
  244.    * Revision 5.1  1992/10/03  22:41:36  syd
  245.    * Initial checkin as of 2.4 Release at PL0
  246.    *
  247. ***************
  248. *** 26,37 ****
  249.   **/
  250.   
  251.   #include "headers.h"
  252. - #include <ctype.h>
  253. - #ifdef BSD
  254. - #undef tolower
  255. - #undef toupper
  256. - #endif
  257.   
  258.   char *qstrpbrk(source, keys)
  259.   char *source, *keys;
  260. --- 38,43 ----
  261.  
  262. Index: lib/realfrom.c
  263. Prereq: 5.3
  264. *** ../elm2.4/lib/realfrom.c    Sat May  8 13:09:56 1993
  265. --- lib/realfrom.c    Tue Aug  3 15:28:56 1993
  266. ***************
  267. *** 1,8 ****
  268.   
  269. ! static char rcsid[] = "@(#)$Id: realfrom.c,v 5.3 1993/05/08 17:09:56 syd Exp $";
  270.   
  271.   /*******************************************************************************
  272. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  273.    *
  274.    *             Copyright (c) 1993 USENET Community Trust
  275.    *******************************************************************************
  276. --- 1,8 ----
  277.   
  278. ! static char rcsid[] = "@(#)$Id: realfrom.c,v 5.4 1993/08/03 19:28:39 syd Exp $";
  279.   
  280.   /*******************************************************************************
  281. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  282.    *
  283.    *             Copyright (c) 1993 USENET Community Trust
  284.    *******************************************************************************
  285. ***************
  286. *** 13,18 ****
  287. --- 13,30 ----
  288.    *
  289.    *******************************************************************************
  290.    * $Log: realfrom.c,v $
  291. +  * Revision 5.4  1993/08/03  19:28:39  syd
  292. +  * Elm tries to replace the system toupper() and tolower() on current
  293. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  294. +  * collide during linking with routines in isctype.o.  This patch adds
  295. +  * a Configure test to determine whether replacements are really needed
  296. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  297. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  298. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  299. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  300. +  * were dropped.
  301. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  302. +  *
  303.    * Revision 5.3  1993/05/08  17:09:56  syd
  304.    * Fix problem where "<space>From" was recognized as a valid "From_" line.
  305.    * From: decwrl!decvax!gatech!WLK.COM!chip (Chip Rosenthal)
  306. ***************
  307. *** 30,40 ****
  308.   
  309.   
  310.   #include "headers.h"
  311. - #include <ctype.h>
  312. - #ifdef BSD
  313. - #undef tolower
  314. - #endif
  315.   
  316.   
  317.   extern long make_gmttime();
  318. --- 42,47 ----
  319.  
  320. Index: lib/rfc822tlen.c
  321. *** /dev/null    Sun Aug 22 23:14:45 1993
  322. --- lib/rfc822tlen.c    Mon Jul 19 23:15:24 1993
  323. ***************
  324. *** 0 ****
  325. --- 1,155 ----
  326. + static char rcsid[] = "@(#)$Id: rfc822tlen.c,v 5.2 1993/07/20 03:15:15 syd Exp $";
  327. + /*******************************************************************************
  328. +  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  329. +  *
  330. +  *            Copyright (c) 1993 USENET Community Trust
  331. +  *******************************************************************************
  332. +  * Bug reports, patches, comments, suggestions should be sent to:
  333. +  *
  334. +  *    Syd Weinstein, Elm Coordinator
  335. +  *    elm@DSI.COM            dsinc!elm
  336. +  *
  337. +  *******************************************************************************
  338. +  * $Log: rfc822tlen.c,v $
  339. +  * Revision 5.2  1993/07/20  03:15:15  syd
  340. +  * remove extra garbage line
  341. +  *
  342. +  * Revision 5.1  1993/06/10  03:02:20  syd
  343. +  * Initial Checkin
  344. +  *
  345. +  *
  346. +  ******************************************************************************/
  347. + #include <stdio.h>
  348. + /*
  349. +  * rfc822_toklen(str) - Returns length of RFC-822 token that starts at "str".
  350. +  *
  351. +  * We understand the following tokens:
  352. +  *
  353. +  *    linear-white-space
  354. +  *    specials
  355. +  *    "quoted string"
  356. +  *    [domain.literal]
  357. +  *    (comment)
  358. +  *    CTL  (control chars)
  359. +  *    atom
  360. +  */
  361. + #define charlen(s)    ((s)[0] == '\\' && (s)[1] != '\0' ? 2 : 1)
  362. + #define IS822_SPECIAL(c) ( \
  363. +     ((c) == '(') || ((c) == ')') || ((c) == '<') || ((c) == '>') \
  364. +     || ((c) == '@') || ((c) == ',') || ((c) == ';') || ((c) == ':') \
  365. +     || ((c) == '\\') || ((c) == '"') || ((c) == '.') || ((c) == '[') \
  366. +     || ((c) == ']') \
  367. + )
  368. + /*
  369. +  * RFC-822 defines SPACE to be just < > and HTAB, but after LWSP folding
  370. +  * CR and NL should be equivalent.
  371. +  */
  372. + #define IS822_SPACE(c) ((c) == ' ' || (c) == '\t' || (c) == '\r' || (c) == '\n')
  373. + /*
  374. +  * We've thrown non-ASCII (value > 0177) into this.
  375. +  */
  376. + #define IS822_CTL(c)    ((c) <= 037 || (c) >= 0177)
  377. + #define IS822_ATOMCH(c)    (!IS822_SPECIAL(c) && !IS822_SPACE(c) && !IS822_CTL(c))
  378. + int rfc822_toklen(str)
  379. + register char *str;
  380. + {
  381. +     char *str0;
  382. +     int depth;
  383. +     register int chlen;
  384. +     str0 = str;
  385. +     if (*str == '"') {            /* quoted-string */
  386. +         ++str;
  387. +         while (*str != '\0' && *str != '"')
  388. +             str += charlen(str);
  389. +         if (*str != '\0')
  390. +             ++str;
  391. +         return (str-str0);
  392. +     }
  393. +     if (*str == '(' ) {            /* comment */
  394. +         ++str;
  395. +         depth = 0;
  396. +         while (*str != '\0' && (*str != ')' || depth > 0)) {
  397. +             switch (*str) {
  398. +             case '(':
  399. +                 ++str;
  400. +                 ++depth;
  401. +                 break;
  402. +             case ')':
  403. +                 ++str;
  404. +                 --depth;
  405. +                 break;
  406. +             default:
  407. +                 str += charlen(str);
  408. +                 break;
  409. +             }
  410. +         }
  411. +         if (*str != '\0')
  412. +             ++str;
  413. +         return (str-str0);
  414. +     }
  415. +     if (*str == '[') {            /* domain-literal */
  416. +         ++str;
  417. +         while (*str != '\0' && *str != ']')
  418. +             str += charlen(str);
  419. +         if (*str != '\0')
  420. +             ++str;
  421. +         return (str-str0);
  422. +     }
  423. +     if (IS822_SPACE(*str)) {        /* linear-white-space */
  424. +         while (++str, IS822_SPACE(*str))
  425. +             ;
  426. +         return (str-str0);
  427. +     }
  428. +     if (IS822_SPECIAL(*str) || IS822_CTL(*str))
  429. +         return charlen(str);        /* specials and CTL */
  430. +     /*
  431. +      * Treat as an "atom".
  432. +      */
  433. +     while (IS822_ATOMCH(*str))
  434. +         ++str;
  435. +     return (str-str0);
  436. + }
  437. + #ifdef _TEST
  438. + main()
  439. + {
  440. +     char buf[1024], *bp;
  441. +     int len;
  442. +     for (;;) {
  443. +         fputs("\nstr> ", stdout);
  444. +         fflush(stdout);
  445. +         if (gets(buf) == NULL) {
  446. +             putchar('\n');
  447. +             break;
  448. +         }
  449. +         bp = buf;
  450. +         while (*bp != '\0') {
  451. +             len = rfc822_toklen(bp);
  452. +             printf("len %4d  |%.*s|\n", len, len, bp);
  453. +             bp += len;
  454. +         }
  455. +     }
  456. +     exit(0);
  457. + }
  458. + #endif
  459.  
  460. Index: lib/shiftlower.c
  461. Prereq: 5.1
  462. *** ../elm2.4/lib/shiftlower.c    Sat Oct  3 18:42:29 1992
  463. --- lib/shiftlower.c    Tue Aug  3 15:28:57 1993
  464. ***************
  465. *** 1,7 ****
  466. ! static char rcsid[] = "@(#)$Id: shiftlower.c,v 5.1 1992/10/03 22:41:36 syd Exp $";
  467.   
  468.   /*******************************************************************************
  469. !  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  470.    *
  471.    *            Copyright (c) 1988-1992 USENET Community Trust
  472.    *            Copyright (c) 1986,1987 Dave Taylor
  473. --- 1,7 ----
  474. ! static char rcsid[] = "@(#)$Id: shiftlower.c,v 5.2 1993/08/03 19:28:39 syd Exp $";
  475.   
  476.   /*******************************************************************************
  477. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  478.    *
  479.    *            Copyright (c) 1988-1992 USENET Community Trust
  480.    *            Copyright (c) 1986,1987 Dave Taylor
  481. ***************
  482. *** 13,18 ****
  483. --- 13,30 ----
  484.    *
  485.    *******************************************************************************
  486.    * $Log: shiftlower.c,v $
  487. +  * Revision 5.2  1993/08/03  19:28:39  syd
  488. +  * Elm tries to replace the system toupper() and tolower() on current
  489. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  490. +  * collide during linking with routines in isctype.o.  This patch adds
  491. +  * a Configure test to determine whether replacements are really needed
  492. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  493. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  494. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  495. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  496. +  * were dropped.
  497. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  498. +  *
  499.    * Revision 5.1  1992/10/03  22:41:36  syd
  500.    * Initial checkin as of 2.4 Release at PL0
  501.    *
  502. ***************
  503. *** 25,37 ****
  504.   
  505.   #include "headers.h"
  506.   
  507. - #include <ctype.h>
  508. - #ifdef BSD
  509. - #undef tolower
  510. - #undef toupper
  511. - #endif
  512.   char *shift_lower(string)
  513.   char *string;
  514.   {
  515. --- 37,42 ----
  516. ***************
  517. *** 42,51 ****
  518.       register char *bufptr = buffer;
  519.   
  520.       for (; *string; string++, bufptr++)
  521. !       if (isupper(*string))
  522. !         *bufptr = tolower(*string);
  523. !       else
  524. !         *bufptr = *string;
  525.       
  526.       *bufptr = 0;
  527.       
  528. --- 47,53 ----
  529.       register char *bufptr = buffer;
  530.   
  531.       for (; *string; string++, bufptr++)
  532. !       *bufptr = tolower(*string);
  533.       
  534.       *bufptr = 0;
  535.       
  536.  
  537. Index: lib/strftime.c
  538. Prereq: 5.4
  539. *** ../elm2.4/lib/strftime.c    Sat May  8 15:56:51 1993
  540. --- lib/strftime.c    Sun Aug 22 22:46:56 1993
  541. ***************
  542. *** 1,8 ****
  543.   
  544. ! static char rcsid[] = "@(#)$Id: strftime.c,v 5.4 1993/05/08 19:56:45 syd Exp $";
  545.   
  546.   /*******************************************************************************
  547. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  548.    *
  549.    * Public-domain relatively quick-and-dirty implemenation of
  550.    * ANSI library routine for System V Unix systems.
  551. --- 1,8 ----
  552.   
  553. ! static char rcsid[] = "@(#)$Id: strftime.c,v 5.8 1993/08/23 02:46:51 syd Exp $";
  554.   
  555.   /*******************************************************************************
  556. !  *  The Elm Mail System  -  $Revision: 5.8 $   $State: Exp $
  557.    *
  558.    * Public-domain relatively quick-and-dirty implemenation of
  559.    * ANSI library routine for System V Unix systems.
  560. ***************
  561. *** 19,24 ****
  562. --- 19,52 ----
  563.    *
  564.    *******************************************************************************
  565.    * $Log: strftime.c,v $
  566. +  * Revision 5.8  1993/08/23  02:46:51  syd
  567. +  * Test ANSI_C, not __STDC__ (which is not set on e.g. AIX).
  568. +  * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
  569. +  *
  570. +  * Revision 5.7  1993/08/03  19:28:39  syd
  571. +  * Elm tries to replace the system toupper() and tolower() on current
  572. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  573. +  * collide during linking with routines in isctype.o.  This patch adds
  574. +  * a Configure test to determine whether replacements are really needed
  575. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  576. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  577. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  578. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  579. +  * were dropped.
  580. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  581. +  *
  582. +  * Revision 5.6  1993/08/03  19:20:31  syd
  583. +  * Implement new timezone handling.  New file lib/get_tz.c with new timezone
  584. +  * routines.  Added new TZMINS_USE_xxxxxx and TZNAME_USE_xxxxxx configuration
  585. +  * definitions.  Obsoleted TZNAME, ALTCHECK, and TZ_MINUTESWEST configuration
  586. +  * definitions.  Updated Configure.  Modified lib/getarpdate.c and
  587. +  * lib/strftime.c to use new timezone routines.
  588. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  589. +  *
  590. +  * Revision 5.5  1993/06/10  03:17:45  syd
  591. +  * Change from TZNAME_MISSING to TZNAME
  592. +  * From: Syd via request from Dan Blanchard
  593. +  *
  594.    * Revision 5.4  1993/05/08  19:56:45  syd
  595.    * update to newer version
  596.    * From: Syd
  597. ***************
  598. *** 79,103 ****
  599.   #ifdef I_SYSTIME
  600.   #  include <sys/time.h>
  601.   #endif
  602. - #ifdef BSD
  603. - #  include <sys/timeb.h>
  604. - #endif
  605.   
  606. ! #include <ctype.h>
  607.   
  608. ! #ifndef __STDC__
  609. ! #define const    /**/
  610.   
  611.   #ifndef BSD
  612. ! extern void tzset();
  613. ! #endif
  614. ! static int weeknumber();
  615. ! #else /* __STDC__ */
  616. ! #ifndef BSD
  617. ! extern void tzset(void);
  618.   #endif
  619. ! static int weeknumber(const struct tm *timeptr, int firstweekday);
  620. ! #endif
  621.   
  622.   /* defaults: season to taste */
  623.   #define SYSV_EXT    1    /* stuff in System V ascftime routine */
  624. --- 107,126 ----
  625.   #ifdef I_SYSTIME
  626.   #  include <sys/time.h>
  627.   #endif
  628.   
  629. ! #if ANSI_C
  630. ! # define P_(x) x
  631. ! #else
  632. ! # define P_(x) /**/
  633. ! # define const    /**/
  634. ! #endif
  635.   
  636. ! extern char *get_tz_name();
  637.   
  638.   #ifndef BSD
  639. ! extern void tzset P_((void));
  640.   #endif
  641. ! static int weeknumber P_((const struct tm *timeptr, int firstweekday));
  642.   
  643.   /* defaults: season to taste */
  644.   #define SYSV_EXT    1    /* stuff in System V ascftime routine */
  645. ***************
  646. *** 133,146 ****
  647.   
  648.   #define range(low, item, hi)    maximum(low, minimum(item, hi))
  649.   
  650. - #ifndef BSD
  651. - extern char *tzname[2];
  652. - extern int daylight;
  653. - #endif
  654.   /* minimum --- return minimum of two numbers */
  655.   
  656. ! #ifndef __STDC__
  657.   static inline int
  658.   minimum(a, b)
  659.   int a, b;
  660. --- 156,164 ----
  661.   
  662.   #define range(low, item, hi)    maximum(low, minimum(item, hi))
  663.   
  664.   /* minimum --- return minimum of two numbers */
  665.   
  666. ! #if !ANSI_C
  667.   static inline int
  668.   minimum(a, b)
  669.   int a, b;
  670. ***************
  671. *** 154,160 ****
  672.   
  673.   /* maximum --- return maximum of two numbers */
  674.   
  675. ! #ifndef __STDC__
  676.   static inline int
  677.   maximum(a, b)
  678.   int a, b;
  679. --- 172,178 ----
  680.   
  681.   /* maximum --- return maximum of two numbers */
  682.   
  683. ! #if !ANSI_C
  684.   static inline int
  685.   maximum(a, b)
  686.   int a, b;
  687. ***************
  688. *** 168,174 ****
  689.   
  690.   /* strftime --- produce formatted time */
  691.   
  692. ! #ifndef __STDC__
  693.   size_t
  694.   strftime(s, maxsize, format, timeptr)
  695.   char *s;
  696. --- 186,192 ----
  697.   
  698.   /* strftime --- produce formatted time */
  699.   
  700. ! #if !ANSI_C
  701.   size_t
  702.   strftime(s, maxsize, format, timeptr)
  703.   char *s;
  704. ***************
  705. *** 394,411 ****
  706.               break;
  707.   
  708.           case 'Z':    /* time zone name or abbrevation */
  709. !             i = 0;
  710. !             if (
  711. ! #ifndef TZNAME_MISSING
  712. !                 daylight &&
  713. ! #endif
  714. !                 timeptr->tm_isdst)
  715. !                 i = 1;
  716. ! #ifdef TZNAME_MISSING
  717. !             strcpy(tbuf, timeptr->tm_zone);
  718. ! #else
  719. !             strcpy(tbuf, tzname[i]);
  720. ! #endif
  721.               break;
  722.   
  723.   #ifdef SYSV_EXT
  724. --- 412,418 ----
  725.               break;
  726.   
  727.           case 'Z':    /* time zone name or abbrevation */
  728. !             strcpy(tbuf, get_tz_name(timeptr));
  729.               break;
  730.   
  731.   #ifdef SYSV_EXT
  732. ***************
  733. *** 528,534 ****
  734.   #ifdef POSIX2_DATE
  735.   /* iso8601wknum --- compute week number according to ISO 8601 */
  736.   
  737. ! #ifndef __STDC__
  738.   static int
  739.   iso8601wknum(timeptr)
  740.   const struct tm *timeptr;
  741. --- 535,541 ----
  742.   #ifdef POSIX2_DATE
  743.   /* iso8601wknum --- compute week number according to ISO 8601 */
  744.   
  745. ! #if !ANSI_C
  746.   static int
  747.   iso8601wknum(timeptr)
  748.   const struct tm *timeptr;
  749. ***************
  750. *** 590,596 ****
  751.   
  752.   /* With thanks and tip of the hatlo to ado@elsie.nci.nih.gov */
  753.   
  754. ! #ifndef __STDC__
  755.   static int
  756.   weeknumber(timeptr, firstweekday)
  757.   const struct tm *timeptr;
  758. --- 597,603 ----
  759.   
  760.   /* With thanks and tip of the hatlo to ado@elsie.nci.nih.gov */
  761.   
  762. ! #if !ANSI_C
  763.   static int
  764.   weeknumber(timeptr, firstweekday)
  765.   const struct tm *timeptr;
  766.  
  767. Index: lib/strincmp.c
  768. Prereq: 5.1
  769. *** ../elm2.4/lib/strincmp.c    Sat Oct  3 18:42:29 1992
  770. --- lib/strincmp.c    Tue Aug  3 15:28:58 1993
  771. ***************
  772. *** 1,8 ****
  773.   
  774. ! static char rcsid[] = "@(#)$Id: strincmp.c,v 5.1 1992/10/03 22:41:36 syd Exp $";
  775.   
  776.   /*******************************************************************************
  777. !  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  778.    *
  779.    *            Copyright (c) 1988-1992 USENET Community Trust
  780.    *            Copyright (c) 1986,1987 Dave Taylor
  781. --- 1,8 ----
  782.   
  783. ! static char rcsid[] = "@(#)$Id: strincmp.c,v 5.2 1993/08/03 19:28:39 syd Exp $";
  784.   
  785.   /*******************************************************************************
  786. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  787.    *
  788.    *            Copyright (c) 1988-1992 USENET Community Trust
  789.    *            Copyright (c) 1986,1987 Dave Taylor
  790. ***************
  791. *** 14,19 ****
  792. --- 14,31 ----
  793.    *
  794.    *******************************************************************************
  795.    * $Log: strincmp.c,v $
  796. +  * Revision 5.2  1993/08/03  19:28:39  syd
  797. +  * Elm tries to replace the system toupper() and tolower() on current
  798. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  799. +  * collide during linking with routines in isctype.o.  This patch adds
  800. +  * a Configure test to determine whether replacements are really needed
  801. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  802. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  803. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  804. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  805. +  * were dropped.
  806. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  807. +  *
  808.    * Revision 5.1  1992/10/03  22:41:36  syd
  809.    * Initial checkin as of 2.4 Release at PL0
  810.    *
  811. ***************
  812. *** 24,35 ****
  813.   **/
  814.   
  815.   #include "headers.h"
  816. - #include <ctype.h>
  817. - #ifdef BSD
  818. - #undef tolower
  819. - #undef toupper
  820. - #endif
  821.   
  822.   int
  823.   strincmp(s1,s2,n)
  824. --- 36,41 ----
  825. ***************
  826. *** 39,46 ****
  827.       /* case insensitive comparison */
  828.       register int d;
  829.       while (--n >= 0) {
  830. !       d = ( isupper(*s1) ? tolower(*s1) : *s1 )
  831. !           - ( isupper(*s2) ? tolower(*s2) : *s2 ) ;
  832.         if ( d != 0 || *s1 == '\0' || *s2 == '\0' )
  833.           return d;
  834.         ++s1;
  835. --- 45,51 ----
  836.       /* case insensitive comparison */
  837.       register int d;
  838.       while (--n >= 0) {
  839. !       d = (tolower(*s1) - tolower(*s2));
  840.         if ( d != 0 || *s1 == '\0' || *s2 == '\0' )
  841.           return d;
  842.         ++s1;
  843.  
  844. Index: lib/striparens.c
  845. Prereq: 5.1
  846. *** ../elm2.4/lib/striparens.c    Sat Oct  3 18:42:30 1992
  847. --- lib/striparens.c    Wed Jun  9 23:09:06 1993
  848. ***************
  849. *** 1,7 ****
  850. ! static char rcsid[] = "@(#)$Id: striparens.c,v 5.1 1992/10/03 22:41:36 syd Exp $";
  851.   
  852.   /*******************************************************************************
  853. !  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  854.    *
  855.    *            Copyright (c) 1988-1992 USENET Community Trust
  856.    *            Copyright (c) 1986,1987 Dave Taylor
  857. --- 1,7 ----
  858. ! static char rcsid[] = "@(#)$Id: striparens.c,v 5.2 1993/06/10 03:09:06 syd Exp $";
  859.   
  860.   /*******************************************************************************
  861. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  862.    *
  863.    *            Copyright (c) 1988-1992 USENET Community Trust
  864.    *            Copyright (c) 1986,1987 Dave Taylor
  865. ***************
  866. *** 13,134 ****
  867.    *
  868.    *******************************************************************************
  869.    * $Log: striparens.c,v $
  870.    * Revision 5.1  1992/10/03  22:41:36  syd
  871.    * Initial checkin as of 2.4 Release at PL0
  872.    *
  873.    *
  874.    ******************************************************************************/
  875.   
  876. ! /** 
  877. ! **/
  878.   
  879.   #include "headers.h"
  880.   
  881.   
  882. ! char *strip_parens(string)
  883. ! char *string;
  884.   {
  885. !     /**
  886. !         Remove parenthesized information from a string.  More specifically,
  887. !         comments as defined in RFC822 are removed.  This procedure is
  888. !         non-destructive - a pointer to static data is returned.
  889. !     **/
  890. !     static char  buffer[VERY_LONG_STRING];
  891. !     register char *bufp;
  892. !     register int depth, l;
  893. !     bufp = buffer;
  894. !     depth = 0;
  895. !     while (*string != '\0') {
  896. !       l = len_next_part(string);
  897. !       if (l == 1) {
  898. !         switch ( *string ) {
  899. !         case '(':            /* begin comment on '('        */
  900. !           ++depth;
  901. !           break;
  902. !         case ')':            /* decr nesting level on ')'    */
  903. !           --depth;
  904. !           break;
  905. !         case '\\':            /* treat next char literally    */
  906. !           if ( *++string == '\0' ) {        /* gracefully handle    */
  907. !         *bufp++ = '\\';            /* '\' at end of string    */
  908. !         --string;                /* even tho it's wrong    */
  909. !           } else if ( depth == 0 ) {
  910. !         *bufp++ = '\\';
  911. !         *bufp++ = *string;
  912. !           }
  913. !           break;
  914. !         default:            /* a regular char        */
  915. !           if ( depth == 0 )
  916. !         *bufp++ = *string;
  917. !           break;
  918. !         }
  919. !         string++;
  920. !       } else {
  921. !         if (depth == 0) {
  922. !           while (--l >= 0)
  923. !         *bufp++ = *string++;
  924. !         } else
  925. !           string += l;
  926. !       }
  927.       }
  928. !     *bufp = '\0';
  929. !     return( (char *) buffer);
  930.   }
  931.   
  932. ! /*
  933. !  * Added by RLH.  This could be combined w/ above if willing to pass
  934. !  * a TRUE/FALSE for whether we are stripping or getting...
  935. !  */
  936. ! char *get_parens(string)
  937. ! char *string;
  938.   {
  939. !     /**
  940. !         Find and return parenthesized information in a string.  More
  941. !         specifically, comments as defined in RFC822 are retrieved.
  942. !         This procedure is non-destructive - a pointer to static data
  943. !         is returned.
  944. !     **/
  945. !     static char  buffer[VERY_LONG_STRING];
  946. !     register char *bufp;
  947. !     register int depth, l;
  948. !     bufp = buffer;
  949. !     depth = 0;
  950. !     while (*string != '\0') {
  951. !       l = len_next_part(string);
  952. !       if (l == 1) {
  953. !         switch ( *string ) {
  954. !         case '(':            /* begin comment on '('        */
  955. !           ++depth;
  956. !           break;
  957. !         case ')':            /* decr nesting level on ')'    */
  958. !           --depth;
  959. !           break;
  960. !         case '\\':            /* treat next char literally    */
  961. !           if ( *++string == '\0' ) {        /* gracefully handle    */
  962. !         *bufp++ = '\\';            /* '\' at end of string    */
  963. !         --string;                /* even tho it's wrong    */
  964. !           } else if ( depth > 0 ) {
  965. !         *bufp++ = '\\';
  966. !         *bufp++ = *string;
  967. !           }
  968. !           break;
  969. !         default:            /* a regular char        */
  970. !           if ( depth > 0 )
  971. !         *bufp++ = *string;
  972. !           break;
  973. !         }
  974. !         string++;
  975. !       } else {
  976. !         if (depth > 0) {
  977. !           while (--l >= 0)
  978. !         *bufp++ = *string++;
  979. !         } else
  980. !           string += l;
  981. !       }
  982.       }
  983. !     *bufp = '\0';
  984. !     return( (char *) buffer);
  985.   }
  986. --- 13,89 ----
  987.    *
  988.    *******************************************************************************
  989.    * $Log: striparens.c,v $
  990. +  * Revision 5.2  1993/06/10  03:09:06  syd
  991. +  * Greatly simplified "lib/striparens.c" to use new rfc822_toklen() routine.
  992. +  * This cut more than 50% out of the object size.  Also added _TEST case.
  993. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  994. +  *
  995.    * Revision 5.1  1992/10/03  22:41:36  syd
  996.    * Initial checkin as of 2.4 Release at PL0
  997.    *
  998.    *
  999.    ******************************************************************************/
  1000.   
  1001. ! /* 
  1002. !  * strip_parens() - Delete all (parenthesized) information from a string.
  1003. !  * get_parens() - Extract all (parenthesized) information from a string.
  1004. !  *
  1005. !  * These routines handle RFC-822 comments.  Nested parens are understood.
  1006. !  * get_parens() does not include the parens in the return result.  Both
  1007. !  * routines are non-destructive.  They return a pointer to static data
  1008. !  * that will be overwritten on the next call to either routine.
  1009. !  */
  1010.   
  1011.   #include "headers.h"
  1012.   
  1013. + static char paren_buffer[VERY_LONG_STRING];
  1014.   
  1015. ! char *strip_parens(src)
  1016. ! register char *src;
  1017.   {
  1018. !     register int len;
  1019. !     register char *dest = paren_buffer;
  1020. !     while (*src != '\0') {
  1021. !         len = rfc822_toklen(src);
  1022. !         if (*src != '(') {    /*)*/
  1023. !             strncpy(dest, src, len);
  1024. !             dest += len;
  1025. !         }
  1026. !         src += len;
  1027.       }
  1028. !     *dest = '\0';
  1029. !     return paren_buffer;
  1030.   }
  1031.   
  1032. ! char *get_parens(src)
  1033. ! register char *src;
  1034.   {
  1035. !     register int len;
  1036. !     register char *dest = paren_buffer;
  1037. !     while (*src != '\0') {
  1038. !         len = rfc822_toklen(src);
  1039. !         if (len > 2 && *src == '(') {    /*)*/
  1040. !             strncpy(dest, src+1, len-2);
  1041. !             dest += (len-2);
  1042. !         }
  1043. !         src += len;
  1044. !     }
  1045. !     *dest = '\0';
  1046. !     return paren_buffer;
  1047. ! }
  1048. ! #ifdef _TEST
  1049. ! main()
  1050. ! {
  1051. !     char buf[1024];
  1052. !     while (fputs("\nstr> ", stdout), gets(buf) != NULL) {
  1053. !         printf("strip_parens() |%s|\n", strip_parens(buf));
  1054. !         printf("get_parens()   |%s|\n", get_parens(buf));
  1055.       }
  1056. !     putchar('\n');
  1057. !     exit(0);
  1058.   }
  1059. + #endif
  1060.  
  1061. Index: lib/strtokq.c
  1062. Prereq: 5.2
  1063. *** ../elm2.4/lib/strtokq.c    Wed Feb  3 11:20:33 1993
  1064. --- lib/strtokq.c    Mon Jul 19 22:05:17 1993
  1065. ***************
  1066. *** 1,8 ****
  1067.   
  1068. ! static char rcsid[] = "@(#)$Id: strtokq.c,v 5.2 1993/02/03 16:20:30 syd Exp $";
  1069.   
  1070.   /*******************************************************************************
  1071. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  1072.    *
  1073.    *            Copyright (c) 1988-1992 USENET Community Trust
  1074.    *            Copyright (c) 1986,1987 Dave Taylor
  1075. --- 1,8 ----
  1076.   
  1077. ! static char rcsid[] = "@(#)$Id: strtokq.c,v 5.3 1993/07/20 02:05:17 syd Exp $";
  1078.   
  1079.   /*******************************************************************************
  1080. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  1081.    *
  1082.    *            Copyright (c) 1988-1992 USENET Community Trust
  1083.    *            Copyright (c) 1986,1987 Dave Taylor
  1084. ***************
  1085. *** 14,19 ****
  1086. --- 14,35 ----
  1087.    *
  1088.    *******************************************************************************
  1089.    * $Log: strtokq.c,v $
  1090. +  * Revision 5.3  1993/07/20  02:05:17  syd
  1091. +  * A long-standing bug of handling replies to VMS systems.
  1092. +  * Original "From: " -line is of format:
  1093. +  *     From: "NAME \"Real Name\"" <USERNAME@vms-system>
  1094. +  * (PMDF mailer)
  1095. +  *     Anyway,  parse_arpa_who()  strips quotes too cleanly
  1096. +  * resulting data:
  1097. +  *     NAME \"Real Name\
  1098. +  * which, when put into parenthesis, becomes:
  1099. +  *     (NAME \"Real Name\)
  1100. +  * which in its turn lacks closing `)'
  1101. +  * Patch of  lib/parsarpwho.c  fixes that.
  1102. +  * strtokq() started one position too late to search for next double-quote (") char.
  1103. +  * Another one-off (chops off trailing comment character, quote or not..)  in   src/reply.c
  1104. +  * From:    Matti Aarnio <mea@utu.fi>
  1105. +  *
  1106.    * Revision 5.2  1993/02/03  16:20:30  syd
  1107.    * add include file
  1108.    *
  1109. ***************
  1110. *** 54,60 ****
  1111.           register char *sp;
  1112.           char quote = *sourceptr++;
  1113.   
  1114. !         for (sp = sourceptr+1; *sp != '\0' && *sp != quote; sp++)
  1115.             if (*sp == '\\') sp++;    /* skip escaped characters */
  1116.                       /* expand_macros will fix them later */
  1117.   
  1118. --- 70,76 ----
  1119.           register char *sp;
  1120.           char quote = *sourceptr++;
  1121.   
  1122. !         for (sp = sourceptr; *sp != '\0' && *sp != quote; sp++)
  1123.             if (*sp == '\\') sp++;    /* skip escaped characters */
  1124.                       /* expand_macros will fix them later */
  1125.   
  1126.  
  1127. Index: nls/C/C/C/s_aliases.m
  1128. *** ../elm2.4/nls/C/C/C/s_aliases.m    Sat May  8 13:03:49 1993
  1129. --- nls/C/C/C/s_aliases.m    Sat Jun 12 01:26:18 1993
  1130. ***************
  1131. *** 31,37 ****
  1132.   $ #MenuLn3
  1133.   16    l)imit display, m)ail, n)ew alias, r)eturn, t)ag, u)ndelete, or e(x)it
  1134.   $ #Sort
  1135. ! 17    Sorting messages by %s...
  1136.   $ group and person must both be 6 characters long
  1137.   $ #Group
  1138.   18    " Group"
  1139. --- 31,37 ----
  1140.   $ #MenuLn3
  1141.   16    l)imit display, m)ail, n)ew alias, r)eturn, t)ag, u)ndelete, or e(x)it
  1142.   $ #Sort
  1143. ! 17    Sorting aliases by %s...
  1144.   $ group and person must both be 6 characters long
  1145.   $ #Group
  1146.   18    " Group"
  1147.  
  1148. Index: nls/C/C/C/s_answer.m
  1149. *** ../elm2.4/nls/C/C/C/s_answer.m    Tue Jan 19 22:36:05 1993
  1150. --- nls/C/C/C/s_answer.m    Tue Aug 10 14:53:57 1993
  1151. ***************
  1152. *** 38,44 ****
  1153.   $ #EnterMessage
  1154.   18    \n\nEnter message for %s ending with a blank line.\n\n
  1155.   $ #ElmCommand
  1156. ! 19    ((%s -s "While You Were Out" %s ; %s %s) & ) < %s > /dev/null
  1157.   $ #CannotHaveMoreNames
  1158.   20    ** Can't have more than 'FirstName LastName' as address!\n
  1159.   $ #NotFoundForGroup
  1160. --- 38,44 ----
  1161.   $ #EnterMessage
  1162.   18    \n\nEnter message for %s ending with a blank line.\n\n
  1163.   $ #ElmCommand
  1164. ! 19    ( ( %s -s "While You Were Out" %s < %s ; %s %s) & ) > /dev/null
  1165.   $ #CannotHaveMoreNames
  1166.   20    ** Can't have more than 'FirstName LastName' as address!\n
  1167.   $ #NotFoundForGroup
  1168.  
  1169. Index: nls/C/C/C/s_elm.m
  1170. *** ../elm2.4/nls/C/C/C/s_elm.m    Mon May 31 15:34:49 1993
  1171. --- nls/C/C/C/s_elm.m    Tue Aug  3 14:58:06 1993
  1172. ***************
  1173. *** 1000,1010 ****
  1174. --- 1000,1012 ----
  1175.   \t -dn\t\tDebug - set debug level to 'n'\n\r\
  1176.   \t -fx\t\tFolder - read folder 'x' rather than incoming mailbox\n\r\
  1177.   \t -h \t\tHelp - give this list of options\n\r\
  1178. + \t -ix\t\tInclude prepared file 'x' in edit buffer for send\n\r\
  1179.   \t -k \t\tKeypad - enable HP 2622 terminal keyboard\n\r
  1180.   $ #ArgsHelp2
  1181.   536    \t -K \t\tKeypad&softkeys - enable use of softkeys + "-k"\n\r\
  1182.   \t -m \t\tMenu - Turn off menu, using more of the screen\n\r\
  1183.   \t -sx\t\tSubject 'x' - for batch mailing\n\r\
  1184. + \t -t \t\tTiTe - don't use termcap/terminfo ti/te entries.\n\r\
  1185.   \t -V \t\tEnable sendmail voyeur mode.\n\r\
  1186.   \t -v \t\tPrint out ELM version information.\n\r\
  1187.   \t -z \t\tZero - don't enter ELM if no mail is pending\n\r\
  1188. ***************
  1189. *** 1066,1073 ****
  1190.   564    Too many weed headers! Out of memory!  Leaving...\n\r
  1191.   $ #NoMemDefaultWeed
  1192.   565    \nNot enough memory for default weedlist. Leaving.\n
  1193. ! $ #CantExpandEnvVar
  1194. ! 566    \n\rCan't expand environment variable '%s'.\n\r
  1195.   $ #CouldntMakeTempFileName
  1196.   567    Sorry - couldn't make file temp file name.
  1197.   $ #CouldntOpenForWriting
  1198. --- 1068,1075 ----
  1199.   564    Too many weed headers! Out of memory!  Leaving...\n\r
  1200.   $ #NoMemDefaultWeed
  1201.   565    \nNot enough memory for default weedlist. Leaving.\n
  1202. ! $ #CannotInitErrorExpanding
  1203. ! 566    \r\nCannot initialize "%s" - error expanding "%s".\r\n
  1204.   $ #CouldntMakeTempFileName
  1205.   567    Sorry - couldn't make file temp file name.
  1206.   $ #CouldntOpenForWriting
  1207.  
  1208. Index: nls/C/C/C/s_elmalias.m
  1209. *** ../elm2.4/nls/C/C/C/s_elmalias.m    Sun Apr 11 22:10:16 1993
  1210. --- nls/C/C/C/s_elmalias.m    Tue Aug 10 14:54:55 1993
  1211. ***************
  1212. *** 1,6 ****
  1213.   $set 4 #Elmalias
  1214.   $ #Usage
  1215. ! 1    usage: %s [-aenrsuvV] [-f format] [alias ...]\n
  1216.   $ #OutOfMemory
  1217.   2    %s: out of memory [could not allocate %d bytes]\n
  1218.   $ #CannotSpecifyExpand
  1219. --- 1,6 ----
  1220.   $set 4 #Elmalias
  1221.   $ #Usage
  1222. ! 1    usage: %s [-adenrsuvV] [-f format] [alias ...]\n
  1223.   $ #OutOfMemory
  1224.   2    %s: out of memory [could not allocate %d bytes]\n
  1225.   $ #CannotSpecifyExpand
  1226.  
  1227. Index: nls/C/C/C/s_filter.m
  1228. *** ../elm2.4/nls/C/C/C/s_filter.m    Mon Feb  8 13:35:25 1993
  1229. --- nls/C/C/C/s_filter.m    Tue Aug  3 15:07:36 1993
  1230. ***************
  1231. *** 29,35 ****
  1232.   $ #EndMesg
  1233.   14    \n-- End of filtered message --\n
  1234.   $ #CouldntCreateLockFile
  1235. ! 15    filter (%s): Couldn't create lock file %s\n
  1236.   $ #CantOpenMailBox
  1237.   16    filter (%s): Can't open mailbox %s!\n
  1238.   $ #SavedMessage
  1239. --- 29,35 ----
  1240.   $ #EndMesg
  1241.   14    \n-- End of filtered message --\n
  1242.   $ #CouldntCreateLockFile
  1243. ! 15    filter (%s): Couldn't create lock file\n
  1244.   $ #CantOpenMailBox
  1245.   16    filter (%s): Can't open mailbox %s!\n
  1246.   $ #SavedMessage
  1247.  
  1248. Index: nls/gencat/dumpmsg.c
  1249. *** ../elm2.4/nls/gencat/dumpmsg.c    Tue Oct  1 11:42:21 1991
  1250. --- nls/gencat/dumpmsg.c    Sun Aug 22 22:46:29 1993
  1251. ***************
  1252. *** 57,63 ****
  1253.   }
  1254.   
  1255.   void main(
  1256. ! #if defined(__STDC__) || defined(__cplusplus)
  1257.           int argc, char *argv[])
  1258.   #else
  1259.           argc, argv)
  1260. --- 57,63 ----
  1261.   }
  1262.   
  1263.   void main(
  1264. ! #if ANSI_C || defined(__cplusplus)
  1265.           int argc, char *argv[])
  1266.   #else
  1267.           argc, argv)
  1268.  
  1269. Index: nls/gencat/gencat.c
  1270. *** ../elm2.4/nls/gencat/gencat.c    Tue Jun 30 20:56:49 1992
  1271. --- nls/gencat/gencat.c    Sun Aug 22 22:46:29 1993
  1272. ***************
  1273. *** 65,82 ****
  1274.    * will be in C syntax, in bar.H in C++ syntax.
  1275.    */
  1276.   
  1277. ! static void writeIfChanged(
  1278. ! #if defined(__STDC__) || defined(__cplusplus)
  1279. !         char *fname, int lang, int orConsts
  1280.   #endif
  1281. ! );
  1282.   
  1283.   void usage() {
  1284. !     fprintf(stderr, "Use: gencat [-new] [-or] [-lang C|C++|ANSIC] catfile msgfile [-h <header-file>]...\n");
  1285.   }
  1286.   
  1287.   void main(
  1288. ! #if defined(__STDC__) || defined(__cplusplus)
  1289.           int argc, char *argv[])
  1290.   #else
  1291.           argc, argv)
  1292. --- 65,87 ----
  1293.    * will be in C syntax, in bar.H in C++ syntax.
  1294.    */
  1295.   
  1296. ! #if ANSI_C || defined(__cplusplus)
  1297. ! # define P_(x) x
  1298. ! #else
  1299. ! # define P_(x) /**/
  1300.   #endif
  1301. ! static void writeIfChanged P_((char *fname, int lang, int orConsts));
  1302. ! #undef P_
  1303.   
  1304.   void usage() {
  1305. !     fprintf(stderr, "Use: gencat [-new] [-or] [-lang C|C++|ANSIC]\n");
  1306. !     fprintf(stderr, "            catfile msgfile [-h <header-file>]...\n");
  1307.   }
  1308.   
  1309.   void main(
  1310. ! #if ANSI_C || defined(__cplusplus)
  1311.           int argc, char *argv[])
  1312.   #else
  1313.           argc, argv)
  1314. ***************
  1315. *** 164,170 ****
  1316.   }
  1317.   
  1318.   static void writeIfChanged(
  1319. ! #if defined(__STDC__) || defined(__cplusplus)
  1320.           char *fname, int lang, int orConsts)
  1321.   #else
  1322.           fname, lang, orConsts)
  1323. --- 169,175 ----
  1324.   }
  1325.   
  1326.   static void writeIfChanged(
  1327. ! #if ANSI_C || defined(__cplusplus)
  1328.           char *fname, int lang, int orConsts)
  1329.   #else
  1330.           fname, lang, orConsts)
  1331.  
  1332. Index: nls/gencat/gencat.h
  1333. *** ../elm2.4/nls/gencat/gencat.h    Mon Sep 23 15:47:46 1991
  1334. --- nls/gencat/gencat.h    Sun Aug 22 22:46:29 1993
  1335. ***************
  1336. *** 79,125 ****
  1337.   
  1338.   #define MAXTOKEN    1024
  1339.   
  1340. ! extern void MCAddSet(
  1341. ! #if defined(__STDC__) || defined(__cplusplus)
  1342. !         int setId, char *c
  1343.   #endif
  1344. !         );
  1345. ! extern void MCDelSet(
  1346. ! #if defined(__STDC__) || defined(__cplusplus)
  1347. !         int setId
  1348. ! #endif
  1349. !         );
  1350. ! extern void MCAddMsg(
  1351. ! #if defined(__STDC__) || defined(__cplusplus)
  1352. !         int msgId, char *msg, char *c
  1353. ! #endif
  1354. !         );
  1355. ! extern void MCDelMsg(
  1356. ! #if defined(__STDC__) || defined(__cplusplus)
  1357. !         int msgId
  1358. ! #endif
  1359. !         );
  1360. ! extern void MCParse(
  1361. ! #if defined(__STDC__) || defined(__cplusplus)
  1362. !         int fd
  1363. ! #endif
  1364. !         );
  1365. ! extern void MCReadCat(
  1366. ! #if defined(__STDC__) || defined(__cplusplus)
  1367. !         int fd
  1368. ! #endif
  1369. !         );
  1370. ! extern void MCWriteConst(
  1371. ! #if defined(__STDC__) || defined(__cplusplus)
  1372. !         int fd, int type, int orConsts
  1373. ! #endif
  1374. !         );
  1375. ! extern void MCWriteCat(
  1376. ! #if defined(__STDC__) || defined(__cplusplus)
  1377. !         int fd
  1378.   #endif
  1379. !         );
  1380. ! extern long MCGetByteOrder();
  1381.   
  1382.   #ifndef True
  1383.   # define True     ~0
  1384. --- 79,103 ----
  1385.   
  1386.   #define MAXTOKEN    1024
  1387.   
  1388. ! #if !defined(ANSI_C) && (defined(__STDC__) || defined(_AIX))
  1389. ! # define ANSI_C 1
  1390.   #endif
  1391. ! #if ANSI_C || defined(__cplusplus)
  1392. ! # define P_(x) x
  1393. ! #else
  1394. ! # define P_(x) /**/
  1395.   #endif
  1396. ! extern void MCAddSet P_((int setId, char *c));
  1397. ! extern void MCDelSet P_((int setId));
  1398. ! extern void MCAddMsg P_((int msgId, char *msg, char *c));
  1399. ! extern void MCDelMsg P_((int msgId));
  1400. ! extern void MCParse P_((int fd));
  1401. ! extern void MCReadCat P_((int fd));
  1402. ! extern void MCWriteConst P_((int fd, int type, int orConsts));
  1403. ! extern void MCWriteCat P_((int fd));
  1404. ! extern long MCGetByteOrder P_((void));
  1405.   
  1406.   #ifndef True
  1407.   # define True     ~0
  1408.  
  1409. Index: src/a_sort.c
  1410. Prereq: 5.4
  1411. *** ../elm2.4/src/a_sort.c    Sun Apr 11 21:10:15 1993
  1412. --- src/a_sort.c    Sat Jun 12 01:27:55 1993
  1413. ***************
  1414. *** 1,8 ****
  1415.   
  1416. ! static char rcsid[] = "@(#)$Id: a_sort.c,v 5.4 1993/04/12 01:10:15 syd Exp $";
  1417.   
  1418.   /*******************************************************************************
  1419. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  1420.    *
  1421.    *             Copyright (c) 1988-1992 USENET Community Trust
  1422.    *             Copyright (c) 1986,1987 Dave Taylor
  1423. --- 1,8 ----
  1424.   
  1425. ! static char rcsid[] = "@(#)$Id: a_sort.c,v 5.5 1993/06/12 05:27:44 syd Exp $";
  1426.   
  1427.   /*******************************************************************************
  1428. !  *  The Elm Mail System  -  $Revision: 5.5 $   $State: Exp $
  1429.    *
  1430.    *             Copyright (c) 1988-1992 USENET Community Trust
  1431.    *             Copyright (c) 1986,1987 Dave Taylor
  1432. ***************
  1433. *** 14,19 ****
  1434. --- 14,23 ----
  1435.    *
  1436.    *******************************************************************************
  1437.    * $Log: a_sort.c,v $
  1438. +  * Revision 5.5  1993/06/12  05:27:44  syd
  1439. +  * Fix calling sequence error
  1440. +  * From: Syd
  1441. +  *
  1442.    * Revision 5.4  1993/04/12  01:10:15  syd
  1443.    * fix @aliasname sort problem
  1444.    * From: "Robert L. Howard" <robert.howard@matd.gatech.edu>
  1445. ***************
  1446. *** 75,81 ****
  1447.   
  1448.       if ((entries > 30) && visible && are_in_aliases) {
  1449.           error1(catgets(elm_msg_cat, AliasesSet, AliasesSort,
  1450. !             "Sorting messages by %s..."), alias_sort_name(FULL));
  1451.       }
  1452.       
  1453.       if (entries > 1)
  1454. --- 79,85 ----
  1455.   
  1456.       if ((entries > 30) && visible && are_in_aliases) {
  1457.           error1(catgets(elm_msg_cat, AliasesSet, AliasesSort,
  1458. !             "Sorting aliases by %s..."), alias_sort_name(FULL));
  1459.       }
  1460.       
  1461.       if (entries > 1)
  1462.  
  1463. Index: src/addr_util.c
  1464. Prereq: 5.10
  1465. *** ../elm2.4/src/addr_util.c    Mon May 31 15:32:21 1993
  1466. --- src/addr_util.c    Tue Aug  3 15:28:59 1993
  1467. ***************
  1468. *** 1,8 ****
  1469.   
  1470. ! static char rcsid[] = "@(#)$Id: addr_util.c,v 5.10 1993/05/31 19:32:20 syd Exp $";
  1471.   
  1472.   /*******************************************************************************
  1473. !  *  The Elm Mail System  -  $Revision: 5.10 $   $State: Exp $
  1474.    *
  1475.    *             Copyright (c) 1988-1992 USENET Community Trust
  1476.    *             Copyright (c) 1986,1987 Dave Taylor
  1477. --- 1,8 ----
  1478.   
  1479. ! static char rcsid[] = "@(#)$Id: addr_util.c,v 5.11 1993/08/03 19:28:39 syd Exp $";
  1480.   
  1481.   /*******************************************************************************
  1482. !  *  The Elm Mail System  -  $Revision: 5.11 $   $State: Exp $
  1483.    *
  1484.    *             Copyright (c) 1988-1992 USENET Community Trust
  1485.    *             Copyright (c) 1986,1987 Dave Taylor
  1486. ***************
  1487. *** 14,19 ****
  1488. --- 14,31 ----
  1489.    *
  1490.    *******************************************************************************
  1491.    * $Log: addr_util.c,v $
  1492. +  * Revision 5.11  1993/08/03  19:28:39  syd
  1493. +  * Elm tries to replace the system toupper() and tolower() on current
  1494. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  1495. +  * collide during linking with routines in isctype.o.  This patch adds
  1496. +  * a Configure test to determine whether replacements are really needed
  1497. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  1498. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  1499. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  1500. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  1501. +  * were dropped.
  1502. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1503. +  *
  1504.    * Revision 5.10  1993/05/31  19:32:20  syd
  1505.    * With this patch build_address() should treat local mailing
  1506.    * lists and other aliases known by the transport agent as valid
  1507. ***************
  1508. *** 80,92 ****
  1509.   #include "headers.h"
  1510.   #include "s_elm.h"
  1511.   
  1512. - #include <ctype.h>
  1513. - #ifdef BSD 
  1514. - #undef tolower
  1515. - #undef toupper
  1516. - #endif
  1517.   
  1518.   translate_return(addr, ret_addr)
  1519.   char *addr, *ret_addr;
  1520. --- 92,97 ----
  1521.  
  1522. Index: src/alias.c
  1523. Prereq: 5.34
  1524. *** ../elm2.4/src/alias.c    Thu May 13 23:57:37 1993
  1525. --- src/alias.c    Tue Aug  3 15:29:00 1993
  1526. ***************
  1527. *** 1,8 ****
  1528.   
  1529. ! static char rcsid[] = "@(#)$Id: alias.c,v 5.34 1993/05/14 03:57:36 syd Exp $";
  1530.   
  1531.   /*******************************************************************************
  1532. !  *  The Elm Mail System  -  $Revision: 5.34 $   $State: Exp $
  1533.    *
  1534.    *             Copyright (c) 1988-1992 USENET Community Trust
  1535.    *             Copyright (c) 1986,1987 Dave Taylor
  1536. --- 1,8 ----
  1537.   
  1538. ! static char rcsid[] = "@(#)$Id: alias.c,v 5.37 1993/08/03 19:28:39 syd Exp $";
  1539.   
  1540.   /*******************************************************************************
  1541. !  *  The Elm Mail System  -  $Revision: 5.37 $   $State: Exp $
  1542.    *
  1543.    *             Copyright (c) 1988-1992 USENET Community Trust
  1544.    *             Copyright (c) 1986,1987 Dave Taylor
  1545. ***************
  1546. *** 14,19 ****
  1547. --- 14,42 ----
  1548.    *
  1549.    *******************************************************************************
  1550.    * $Log: alias.c,v $
  1551. +  * Revision 5.37  1993/08/03  19:28:39  syd
  1552. +  * Elm tries to replace the system toupper() and tolower() on current
  1553. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  1554. +  * collide during linking with routines in isctype.o.  This patch adds
  1555. +  * a Configure test to determine whether replacements are really needed
  1556. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  1557. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  1558. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  1559. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  1560. +  * were dropped.
  1561. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1562. +  *
  1563. +  * Revision 5.36  1993/06/12  05:27:44  syd
  1564. +  * Fix calling sequence error
  1565. +  * From: Syd
  1566. +  *
  1567. +  * Revision 5.35  1993/06/10  02:58:26  syd
  1568. +  * Correct problem in fetch_alias() with alias record fixup that caused
  1569. +  * core dump on machines with pointers larger than int.  This problem
  1570. +  * was reported on comp.mail.elm by Richard Eckman and Jim Brown.  Simplify
  1571. +  * get_one_alias() by having it use fetch_alias().
  1572. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1573. +  *
  1574.    * Revision 5.34  1993/05/14  03:57:36  syd
  1575.    * A couple of calls to want_to() had typos. Here is the patch.
  1576.    * From: Jukka Ukkonen <ukkonen@csc.fi>
  1577. ***************
  1578. *** 230,244 ****
  1579.   #include "headers.h"
  1580.   #include "s_elm.h"
  1581.   #include <errno.h>
  1582. - #include <ctype.h>
  1583.   #include <sys/stat.h>
  1584.   #include "s_aliases.h"
  1585.   #include "ndbz.h"
  1586.   
  1587. - #ifdef BSD
  1588. - #undef        tolower
  1589. - #endif
  1590.   #define    ECHOIT    1     /* echo on for prompting */
  1591.   
  1592.   /*
  1593. --- 253,262 ----
  1594. ***************
  1595. *** 984,990 ****
  1596.   
  1597.       main_state();        /* Save globals for return to main menu */
  1598.   
  1599. !     open_alias_files();    /* First, read the alias files. RLH */
  1600.   
  1601.       alias_screen(newaliases);
  1602.       define_softkeys(ALIAS);
  1603. --- 1002,1008 ----
  1604.   
  1605.       main_state();        /* Save globals for return to main menu */
  1606.   
  1607. !     open_alias_files(FALSE);    /* First, read the alias files. RLH */
  1608.   
  1609.       alias_screen(newaliases);
  1610.       define_softkeys(ALIAS);
  1611. ***************
  1612. *** 1305,1311 ****
  1613.             "Processed %d aliases.  Re-reading the database..."), na);
  1614.           if (sleepmsg > 0)
  1615.           sleep(sleepmsg);
  1616. !         open_alias_files();
  1617.           set_error(catgets(elm_msg_cat, AliasesSet, AliasesUpdatedOK,
  1618.             "Aliases updated successfully."));
  1619.       }
  1620. --- 1323,1329 ----
  1621.             "Processed %d aliases.  Re-reading the database..."), na);
  1622.           if (sleepmsg > 0)
  1623.           sleep(sleepmsg);
  1624. !         open_alias_files(TRUE);
  1625.           set_error(catgets(elm_msg_cat, AliasesSet, AliasesUpdatedOK,
  1626.             "Aliases updated successfully."));
  1627.       }
  1628. ***************
  1629. *** 1537,1610 ****
  1630.    *    Get an alias (name, address, etc.) from the data file
  1631.    */
  1632.   
  1633. !     long new_max;
  1634. !     register struct alias_rec    **new_aliases, *a;
  1635. !     struct alias_rec    ar;
  1636. !     FILE *data_file = db->dbz_basef;
  1637.   
  1638. !     if(read_one_alias(db, &ar) == 0) {
  1639. !         return(0);
  1640. !     }
  1641.   
  1642.       if (current >= max_aliases) {
  1643.           new_max = max_aliases + KLICK;
  1644. !         if (max_aliases == 0)
  1645. !         new_aliases = (struct alias_rec **)
  1646. !             malloc(new_max * sizeof(struct alias_rec *));
  1647. !         else
  1648. !         new_aliases = (struct alias_rec **)
  1649. !             realloc((char *) aliases,
  1650. !             new_max * sizeof(struct alias_rec *));
  1651. !         if (new_aliases == NULL) {
  1652. !         error1(catgets(elm_msg_cat, AliasesSet, AliasesErrorMemory,
  1653. !       "\n\r\n\rCouldn't allocate enough memory! Alias #%d.\n\r\n\r"),
  1654. !             current);
  1655. !         return(0);
  1656.           }
  1657. -         aliases = new_aliases;
  1658.           while (max_aliases < new_max)
  1659.           aliases[max_aliases++] = NULL;
  1660.       }
  1661.   
  1662. !     if (aliases[current] != NULL) {
  1663. !         free((char *) aliases[current]);
  1664. !         aliases[current] = NULL;
  1665. !     }
  1666. !     if ((a = (struct alias_rec *)
  1667. !         malloc(sizeof(ar) + ar.length)) == NULL) {
  1668. !         error1(catgets(elm_msg_cat, AliasesSet, AliasesErrorMemory,
  1669. !       "\n\r\n\rCouldn't allocate enough memory! Alias #%d.\n\r\n\r"),
  1670. !             current);
  1671. !         return(0);
  1672. !         }
  1673.       aliases[current] = a;
  1674. !     fread((char *) (a + 1), ar.length, 1, data_file);
  1675. !     *a = ar;
  1676. ! #ifdef CRAY
  1677. !     a->alias = (int) a->alias + (char *) (a + 1);
  1678. !     a->last_name = (int) a->last_name + (char *) (a + 1);
  1679. !     a->name = (int) a->name + (char *) (a + 1);
  1680. !     a->comment = (int) a->comment + (char *) (a + 1);
  1681. !     a->address = (int) a->address + (char *) (a + 1);
  1682. ! #else
  1683. !     new_max = (long) (a + 1);
  1684. !     a->alias += new_max;
  1685. !     a->last_name += new_max;
  1686. !     a->name += new_max;
  1687. !     a->comment += new_max;
  1688. !     a->address += new_max;
  1689. ! #endif
  1690. !     a->length = current;   
  1691. !   
  1692. !     return(1);
  1693.   }
  1694.   
  1695.   main_state()
  1696.   {
  1697.   /*    Save the globals that are shared for both menus
  1698. --- 1555,1587 ----
  1699.    *    Get an alias (name, address, etc.) from the data file
  1700.    */
  1701.   
  1702. !     int new_max;
  1703. !     register struct alias_rec *a;
  1704. !     extern struct alias_rec *fetch_alias();
  1705.   
  1706. !     if ((a = fetch_alias(db, (char *)NULL)) == NULL)
  1707. !         return 0;
  1708.   
  1709.       if (current >= max_aliases) {
  1710.           new_max = max_aliases + KLICK;
  1711. !         if (max_aliases == 0) {
  1712. !         aliases = (struct alias_rec **)
  1713. !             safe_malloc(new_max * sizeof(struct alias_rec *));
  1714. !         } else {
  1715. !         aliases = (struct alias_rec **) safe_realloc((malloc_t)aliases,
  1716. !             new_max * sizeof(struct alias_rec *));
  1717.           }
  1718.           while (max_aliases < new_max)
  1719.           aliases[max_aliases++] = NULL;
  1720.       }
  1721.   
  1722. !     if (aliases[current] != NULL)
  1723. !         free((malloc_t)aliases[current]);
  1724.       aliases[current] = a;
  1725. !     return 1;
  1726.   }
  1727.   
  1728.   main_state()
  1729.   {
  1730.   /*    Save the globals that are shared for both menus
  1731.  
  1732. Index: src/aliaslib.c
  1733. Prereq: 5.9
  1734. *** ../elm2.4/src/aliaslib.c    Mon May 31 15:39:44 1993
  1735. --- src/aliaslib.c    Tue Aug  3 15:29:01 1993
  1736. ***************
  1737. *** 1,8 ****
  1738.   
  1739. ! static char rcsid[] = "@(#)$Id: aliaslib.c,v 5.9 1993/05/31 19:39:43 syd Exp $";
  1740.   
  1741.   /*******************************************************************************
  1742. !  *  The Elm Mail System  -  $Revision: 5.9 $   $State: Exp $
  1743.    *
  1744.    *             Copyright (c) 1988-1992 USENET Community Trust
  1745.    *             Copyright (c) 1986,1987 Dave Taylor
  1746. --- 1,8 ----
  1747.   
  1748. ! static char rcsid[] = "@(#)$Id: aliaslib.c,v 5.10 1993/08/03 19:28:39 syd Exp $";
  1749.   
  1750.   /*******************************************************************************
  1751. !  *  The Elm Mail System  -  $Revision: 5.10 $   $State: Exp $
  1752.    *
  1753.    *             Copyright (c) 1988-1992 USENET Community Trust
  1754.    *             Copyright (c) 1986,1987 Dave Taylor
  1755. ***************
  1756. *** 14,19 ****
  1757. --- 14,31 ----
  1758.    *
  1759.    *******************************************************************************
  1760.    * $Log: aliaslib.c,v $
  1761. +  * Revision 5.10  1993/08/03  19:28:39  syd
  1762. +  * Elm tries to replace the system toupper() and tolower() on current
  1763. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  1764. +  * collide during linking with routines in isctype.o.  This patch adds
  1765. +  * a Configure test to determine whether replacements are really needed
  1766. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  1767. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  1768. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  1769. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  1770. +  * were dropped.
  1771. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1772. +  *
  1773.    * Revision 5.9  1993/05/31  19:39:43  syd
  1774.    * Elm either failed to expand a group alias or crashed in strlen
  1775.    * (called from do_expand_group()).
  1776. ***************
  1777. *** 70,76 ****
  1778.   
  1779.   #include "headers.h"
  1780.   #include "s_elm.h"
  1781. - #include <ctype.h>
  1782.   
  1783.   char *get_alias_address(), *qstrpbrk();
  1784.   extern int current_mail_message;
  1785. --- 82,87 ----
  1786.  
  1787. Index: src/builtin.c
  1788. Prereq: 5.1
  1789. *** ../elm2.4/src/builtin.c    Sat Oct  3 18:58:47 1992
  1790. --- src/builtin.c    Tue Aug  3 15:29:01 1993
  1791. ***************
  1792. *** 1,8 ****
  1793.   
  1794. ! static char rcsid[] = "@(#)$Id: builtin.c,v 5.1 1992/10/03 22:58:40 syd Exp $";
  1795.   
  1796.   /*******************************************************************************
  1797. !  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  1798.    *
  1799.    *             Copyright (c) 1988-1992 USENET Community Trust
  1800.    *             Copyright (c) 1986,1987 Dave Taylor
  1801. --- 1,8 ----
  1802.   
  1803. ! static char rcsid[] = "@(#)$Id: builtin.c,v 5.2 1993/08/03 19:28:39 syd Exp $";
  1804.   
  1805.   /*******************************************************************************
  1806. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  1807.    *
  1808.    *             Copyright (c) 1988-1992 USENET Community Trust
  1809.    *             Copyright (c) 1986,1987 Dave Taylor
  1810. ***************
  1811. *** 14,19 ****
  1812. --- 14,31 ----
  1813.    *
  1814.    *******************************************************************************
  1815.    * $Log: builtin.c,v $
  1816. +  * Revision 5.2  1993/08/03  19:28:39  syd
  1817. +  * Elm tries to replace the system toupper() and tolower() on current
  1818. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  1819. +  * collide during linking with routines in isctype.o.  This patch adds
  1820. +  * a Configure test to determine whether replacements are really needed
  1821. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  1822. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  1823. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  1824. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  1825. +  * were dropped.
  1826. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1827. +  *
  1828.    * Revision 5.1  1992/10/03  22:58:40  syd
  1829.    * Initial checkin as of 2.4 Release at PL0
  1830.    *
  1831. ***************
  1832. *** 32,38 ****
  1833.   
  1834.   #include "headers.h"
  1835.   #include "s_elm.h"
  1836. - #include <ctype.h>
  1837.   
  1838.   #define  BEEP        007        /* ASCII Bell character */
  1839.   
  1840. --- 44,49 ----
  1841.  
  1842. Index: src/curses.c
  1843. Prereq: 5.10
  1844. *** ../elm2.4/src/curses.c    Sun Apr 11 23:57:46 1993
  1845. --- src/curses.c    Sun Aug 22 22:56:36 1993
  1846. ***************
  1847. *** 1,8 ****
  1848.   
  1849. ! static char rcsid[] = "@(#)$Id: curses.c,v 5.10 1993/04/12 03:57:45 syd Exp $";
  1850.   
  1851.   /*******************************************************************************
  1852. !  *  The Elm Mail System  -  $Revision: 5.10 $   $State: Exp $
  1853.    *
  1854.    *             Copyright (c) 1988-1992 USENET Community Trust
  1855.    *             Copyright (c) 1986,1987 Dave Taylor
  1856. --- 1,8 ----
  1857.   
  1858. ! static char rcsid[] = "@(#)$Id: curses.c,v 5.13 1993/08/23 02:56:35 syd Exp $";
  1859.   
  1860.   /*******************************************************************************
  1861. !  *  The Elm Mail System  -  $Revision: 5.13 $   $State: Exp $
  1862.    *
  1863.    *             Copyright (c) 1988-1992 USENET Community Trust
  1864.    *             Copyright (c) 1986,1987 Dave Taylor
  1865. ***************
  1866. *** 14,19 ****
  1867. --- 14,42 ----
  1868.    *
  1869.    *******************************************************************************
  1870.    * $Log: curses.c,v $
  1871. +  * Revision 5.13  1993/08/23  02:56:35  syd
  1872. +  * have Writechar() backspace over the left edge of the screen to the end
  1873. +  * of the previous line if the current line is not the first line on the
  1874. +  * screen.
  1875. +  * From: Jukka Ukkonen <ukkonen@csc.fi>
  1876. +  *
  1877. +  * Revision 5.12  1993/08/03  19:28:39  syd
  1878. +  * Elm tries to replace the system toupper() and tolower() on current
  1879. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  1880. +  * collide during linking with routines in isctype.o.  This patch adds
  1881. +  * a Configure test to determine whether replacements are really needed
  1882. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  1883. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  1884. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  1885. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  1886. +  * were dropped.
  1887. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1888. +  *
  1889. +  * Revision 5.11  1993/07/20  02:13:20  syd
  1890. +  * Make tabspacing check for <= 0 so we dont get divide by
  1891. +  * zero errors when the termcap has tabspacing 0
  1892. +  * From: Syd via request from G A Smant
  1893. +  *
  1894.    * Revision 5.10  1993/04/12  03:57:45  syd
  1895.    * Give up and add an Ultrix specific patch. There is a bug in Ispell under
  1896.    * ultrix.  The problem is that when ispell returns, the terminal is no
  1897. ***************
  1898. *** 90,106 ****
  1899.   # endif
  1900.   #endif
  1901.   
  1902. - #include <ctype.h>
  1903.   #ifdef PTEM
  1904.   #  include <sys/stream.h>
  1905.   #  include <sys/ptem.h>
  1906.   #endif
  1907.   
  1908. - #ifdef BSD
  1909. - #undef tolower
  1910. - #endif
  1911.   #define TTYIN    0
  1912.   
  1913.   #ifdef SHORTNAMES
  1914. --- 113,123 ----
  1915. ***************
  1916. *** 202,208 ****
  1917.       _cleartoeos        = tgetstr("cd", &ptr);
  1918.       _lines                 = tgetnum("li");
  1919.       _columns       = tgetnum("co");
  1920. !     tabspacing       = ((tabspacing=tgetnum("it"))==-1 ? 8 : tabspacing);
  1921.       _automargin       = tgetflag("am");
  1922.       _eatnewlineglitch   = tgetflag("xn");
  1923.       _transmit_on       = tgetstr("ks", &ptr);
  1924. --- 219,225 ----
  1925.       _cleartoeos        = tgetstr("cd", &ptr);
  1926.       _lines                 = tgetnum("li");
  1927.       _columns       = tgetnum("co");
  1928. !     tabspacing       = ((tabspacing=tgetnum("it"))<= 0 ? 8 : tabspacing);
  1929.       _automargin       = tgetflag("am");
  1930.       _eatnewlineglitch   = tgetflag("xn");
  1931.       _transmit_on       = tgetstr("ks", &ptr);
  1932. ***************
  1933. *** 706,715 ****
  1934.   
  1935.       /* if backspace, move back  one space  if not already in column 0 */
  1936.       else if (ch == BACKSPACE) {
  1937. !       if(_col != 0) {
  1938. !         tputs(_left, 1, outchar);
  1939. !         _col--;
  1940. !       } /* else BACKSPACE does nothing */
  1941.       }
  1942.   
  1943.       /* if bell, ring the bell but don't advance the column */
  1944. --- 723,738 ----
  1945.   
  1946.       /* if backspace, move back  one space  if not already in column 0 */
  1947.       else if (ch == BACKSPACE) {
  1948. !         if (_col != 0) {
  1949. !         tputs(_left, 1, outchar);
  1950. !         _col--;
  1951. !         }
  1952. !         else if (_line > 0) {
  1953. !         _col = COLUMNS - 1;
  1954. !         _line--;
  1955. !         moveabsolute (_col, _line);
  1956. !         }
  1957. !         /* else BACKSPACE does nothing */
  1958.       }
  1959.   
  1960.       /* if bell, ring the bell but don't advance the column */
  1961.  
  1962. Index: src/date.c
  1963. Prereq: 5.4
  1964. *** ../elm2.4/src/date.c    Thu Dec 10 20:45:32 1992
  1965. --- src/date.c    Tue Aug  3 15:29:03 1993
  1966. ***************
  1967. *** 1,8 ****
  1968.   
  1969. ! static char rcsid[] = "@(#)$Id: date.c,v 5.4 1992/12/11 01:45:04 syd Exp $";
  1970.   
  1971.   /*******************************************************************************
  1972. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  1973.    *
  1974.    *             Copyright (c) 1988-1992 USENET Community Trust
  1975.    *             Copyright (c) 1986,1987 Dave Taylor
  1976. --- 1,8 ----
  1977.   
  1978. ! static char rcsid[] = "@(#)$Id: date.c,v 5.5 1993/08/03 19:28:39 syd Exp $";
  1979.   
  1980.   /*******************************************************************************
  1981. !  *  The Elm Mail System  -  $Revision: 5.5 $   $State: Exp $
  1982.    *
  1983.    *             Copyright (c) 1988-1992 USENET Community Trust
  1984.    *             Copyright (c) 1986,1987 Dave Taylor
  1985. ***************
  1986. *** 14,19 ****
  1987. --- 14,31 ----
  1988.    *
  1989.    *******************************************************************************
  1990.    * $Log: date.c,v $
  1991. +  * Revision 5.5  1993/08/03  19:28:39  syd
  1992. +  * Elm tries to replace the system toupper() and tolower() on current
  1993. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  1994. +  * collide during linking with routines in isctype.o.  This patch adds
  1995. +  * a Configure test to determine whether replacements are really needed
  1996. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  1997. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  1998. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  1999. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  2000. +  * were dropped.
  2001. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2002. +  *
  2003.    * Revision 5.4  1992/12/11  01:45:04  syd
  2004.    * remove sys/types.h include, it is now included by defs.h
  2005.    * and this routine includes defs.h or indirectly includes defs.h
  2006. ***************
  2007. *** 49,65 ****
  2008.   #  include <sys/timeb.h>
  2009.   #endif
  2010.   
  2011. - #include <ctype.h>
  2012.   #ifndef    _POSIX_SOURCE
  2013.   extern struct tm *localtime();
  2014.   extern struct tm *gmtime();
  2015.   extern time_t      time();
  2016.   #endif
  2017. - #ifdef BSD
  2018. - #undef tolower
  2019. - #endif
  2020.   
  2021.   #define MONTHS_IN_YEAR    11    /* 0-11 equals 12 months! */
  2022.   #define FEB         1    /* 0 = January           */
  2023. --- 61,71 ----
  2024.  
  2025. Index: src/editmsg.c
  2026. Prereq: 5.12
  2027. *** ../elm2.4/src/editmsg.c    Sat May  8 16:25:38 1993
  2028. --- src/editmsg.c    Sun Aug 22 23:26:46 1993
  2029. ***************
  2030. *** 1,8 ****
  2031.   
  2032. ! static char rcsid[] = "@(#)$Id: editmsg.c,v 5.12 1993/05/08 20:25:33 syd Exp $";
  2033.   
  2034.   /*******************************************************************************
  2035. !  *  The Elm Mail System  -  $Revision: 5.12 $   $State: Exp $
  2036.    *
  2037.    *             Copyright (c) 1988-1992 USENET Community Trust
  2038.    *            Copyright (c) 1986,1987 Dave Taylor
  2039. --- 1,8 ----
  2040.   
  2041. ! static char rcsid[] = "@(#)$Id: editmsg.c,v 5.18 1993/08/23 03:26:24 syd Exp $";
  2042.   
  2043.   /*******************************************************************************
  2044. !  *  The Elm Mail System  -  $Revision: 5.18 $   $State: Exp $
  2045.    *
  2046.    *             Copyright (c) 1988-1992 USENET Community Trust
  2047.    *            Copyright (c) 1986,1987 Dave Taylor
  2048. ***************
  2049. *** 14,19 ****
  2050. --- 14,82 ----
  2051.    *
  2052.    *******************************************************************************
  2053.    * $Log: editmsg.c,v $
  2054. +  * Revision 5.18  1993/08/23  03:26:24  syd
  2055. +  * Try setting group id separate from user id in chown to
  2056. +  * allow restricted systems to change group id of file
  2057. +  * From: Syd
  2058. +  *
  2059. +  * Revision 5.17  1993/08/23  02:55:38  syd
  2060. +  * Fix problem where deleting to previous line caused duplication due to the
  2061. +  * file being opened for append (in append mode, all writes are to the end of
  2062. +  * file regardless of the file pointer).
  2063. +  * From: pdc@lunch.asd.sgi.com (Paul Close)
  2064. +  *
  2065. +  * Revision 5.16  1993/08/03  20:12:46  syd
  2066. +  * Fix signal type for 386bsd
  2067. +  * From: Scott Mace <smace@freefall.cdrom.com>
  2068. +  *
  2069. +  * Revision 5.15  1993/08/03  19:28:39  syd
  2070. +  * Elm tries to replace the system toupper() and tolower() on current
  2071. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  2072. +  * collide during linking with routines in isctype.o.  This patch adds
  2073. +  * a Configure test to determine whether replacements are really needed
  2074. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  2075. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  2076. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  2077. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  2078. +  * were dropped.
  2079. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2080. +  *
  2081. +  * Revision 5.14  1993/07/20  02:41:24  syd
  2082. +  * Three changes to expand_env() in src/read_rc.c:  make it non-destructive,
  2083. +  * have it return an error code instead of bailing out, and add a buffer
  2084. +  * size argument to avoid overwritting the destination.  The first is to
  2085. +  * avoid all of the gymnastics Elm needed to go through (and occasionally
  2086. +  * forgot to go through) to protect the value handed to expand_env().
  2087. +  * The second is because expand_env() was originally written to support
  2088. +  * "elmrc" and bailing out was a reasonable thing to do there -- but not
  2089. +  * in the other places where it has since been used.  The third is just
  2090. +  * a matter of practicing safe source code.
  2091. +  *
  2092. +  * This patch changes all invocations to expand_env() to eliminate making
  2093. +  * temporary copies (now that the routine is non-destructive) and to pass
  2094. +  * in a destination length.  Since expand_env() no longer bails out on
  2095. +  * error, a do_expand_env() routine was added to src/read_rc.c handle
  2096. +  * this.  Moreover, the error message now gives some indication of what
  2097. +  * the problem is rather than just saying "can't expand".
  2098. +  *
  2099. +  * Gratitous change to src/editmsg.c renaming filename variables to
  2100. +  * clarify the purpose.
  2101. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2102. +  *
  2103. +  * Revision 5.13  1993/06/10  03:07:39  syd
  2104. +  * This fixes a bug in the MIME code.  Include_Part() uses expand_env()
  2105. +  * to expand the include file name, but since expand_env() is destructive
  2106. +  * [it uses strtok()] the file name gets corrupted, and the "Content-Name"
  2107. +  * header can contain a bogus value.  The easy fix would be a one-line
  2108. +  * hack to Include_Part to use a temporary buffer.  This patch does not
  2109. +  * implement the easy fix.  *Every* place expand_env() is used, its side
  2110. +  * effects cause problems.  I think the right fix is to make expand_env()
  2111. +  * non-destructive (i.e. have it duplicate the input to a temporary buffer
  2112. +  * and work from there).  The attached patch modifies expand_env() in
  2113. +  * that manner, and eliminates all of the `copy to a temporary buffer'
  2114. +  * calls that precede it throughout elm.
  2115. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2116. +  *
  2117.    * Revision 5.12  1993/05/08  20:25:33  syd
  2118.    * Add sleepmsg to control transient message delays
  2119.    * From: Syd
  2120. ***************
  2121. *** 81,89 ****
  2122.   /* BSD has already included setjmp.h in headers.h */
  2123.   #include <setjmp.h>
  2124.   #endif /* BSD */
  2125. - #include <ctype.h>
  2126.   
  2127. ! #ifdef POSIX_SIGNALS
  2128.   # define JMP_BUF        sigjmp_buf
  2129.   # define SETJMP(env)        sigsetjmp((env), 1)
  2130.   # define LONGJMP(env,val)    siglongjmp((env), (val))
  2131. --- 144,151 ----
  2132.   /* BSD has already included setjmp.h in headers.h */
  2133.   #include <setjmp.h>
  2134.   #endif /* BSD */
  2135.   
  2136. ! #if defined(POSIX_SIGNALS) && !defined(__386BSD__)
  2137.   # define JMP_BUF        sigjmp_buf
  2138.   # define SETJMP(env)        sigsetjmp((env), 1)
  2139.   # define LONGJMP(env,val)    siglongjmp((env), (val))
  2140. ***************
  2141. *** 93,102 ****
  2142.   # define LONGJMP(env,val)    longjmp((env), (val))
  2143.   #endif
  2144.   
  2145. - #ifdef BSD
  2146. - #undef        tolower
  2147. - #endif
  2148.   char *error_description(), *format_long(), *strip_commas();
  2149.   long  fsize();
  2150.   
  2151. --- 155,160 ----
  2152. ***************
  2153. *** 202,228 ****
  2154.           of lines and characters we added, if any... **/
  2155.   
  2156.       FILE *myfd;
  2157. !     char myfname[SLEN], buffer[SLEN];
  2158.       register int n;
  2159.       register int lines = 0, nchars = 0;
  2160.   
  2161. !     for ( n = 0 ; whitespace(filename[n]) ; n++ );
  2162.   
  2163. !     /** expand any shell variables, '~' or other notation... **/
  2164. !     /* temp copy of filename to buffer since expand_env is destructive */
  2165. !     strcpy(buffer, &filename[n]);
  2166. !     expand_env(myfname, buffer);
  2167.   
  2168. !     if (strlen(myfname) == 0) {
  2169.         Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNoFilenameSpecified,
  2170.             "\n\r(No filename specified for file read! Continue.)\n\r"), 0);
  2171.         return;
  2172.       }
  2173.   
  2174. !     if ((myfd = fopen(myfname,"r")) == NULL) {
  2175.         Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmCouldntReadFile,
  2176. !         "\n\r(Couldn't read file '%s'! Continue.)\n\r"), 1,
  2177. !          myfname);
  2178.         return;
  2179.       }
  2180.   
  2181. --- 260,284 ----
  2182.           of lines and characters we added, if any... **/
  2183.   
  2184.       FILE *myfd;
  2185. !     char exp_fname[SLEN], buffer[SLEN];
  2186.       register int n;
  2187.       register int lines = 0, nchars = 0;
  2188.   
  2189. !     while (whitespace(*filename))
  2190. !         ++filename;
  2191.   
  2192. !     /** expand any shell variables or leading '~' **/
  2193. !     (void) expand_env(exp_fname, filename, sizeof(exp_fname));
  2194.   
  2195. !     if (exp_fname[0] == '\0') {
  2196.         Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNoFilenameSpecified,
  2197.             "\n\r(No filename specified for file read! Continue.)\n\r"), 0);
  2198.         return;
  2199.       }
  2200.   
  2201. !     if ((myfd = fopen(exp_fname,"r")) == NULL) {
  2202.         Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmCouldntReadFile,
  2203. !         "\n\r(Couldn't read file '%s'! Continue.)\n\r"), 1, exp_fname);
  2204.         return;
  2205.       }
  2206.   
  2207. ***************
  2208. *** 251,257 ****
  2209.   
  2210.       if (show_user_filename)
  2211.         Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmAddedFromFile,
  2212. !         "from file %s. Continue.)\n\r"), 1, myfname);
  2213.       else
  2214.         Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmAddedToMessage,
  2215.           "to message. Continue.)\n\r"), 0);
  2216. --- 307,313 ----
  2217.   
  2218.       if (show_user_filename)
  2219.         Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmAddedFromFile,
  2220. !         "from file %s. Continue.)\n\r"), 1, exp_fname);
  2221.       else
  2222.         Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmAddedToMessage,
  2223.           "to message. Continue.)\n\r"), 0);
  2224. ***************
  2225. *** 542,548 ****
  2226.           sprintf(buffer, "%s %s", editor, filename);
  2227.       }
  2228.   
  2229. !     chown(filename, userid, groupid);    /* file was owned by root! */
  2230.   
  2231.       if (( old_raw = RawState()) == ON)
  2232.         Raw(OFF);
  2233. --- 598,605 ----
  2234.           sprintf(buffer, "%s %s", editor, filename);
  2235.       }
  2236.   
  2237. !     chown(filename, -1, groupid);    /* on systems where we cannot change both, change group id at least */
  2238. !     chown(filename, userid, -1);    /* file was owned by root! */
  2239.   
  2240.       if (( old_raw = RawState()) == ON)
  2241.         Raw(OFF);
  2242. ***************
  2243. *** 610,619 ****
  2244.             "(Continue entering message.  Type ^D or '.' on a line by itself to end.)\n\r");
  2245.       }
  2246.   
  2247. !     if ((edit_fd = fopen(filename, "a+")) == NULL) {
  2248.         err = errno;
  2249.         sprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmCouldntOpenAppend,
  2250. !         "Couldn't open %s for appending [%s]."),
  2251.           filename, error_description(err));
  2252.         Write_to_screen(buffer, 0);
  2253.         dprint(1, (debugfile,
  2254. --- 667,676 ----
  2255.             "(Continue entering message.  Type ^D or '.' on a line by itself to end.)\n\r");
  2256.       }
  2257.   
  2258. !     if ((edit_fd = fopen(filename, "r+")) == NULL) {
  2259.         err = errno;
  2260.         sprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmCouldntOpenAppend,
  2261. !         "Couldn't open %s for update [%s]."),
  2262.           filename, error_description(err));
  2263.         Write_to_screen(buffer, 0);
  2264.         dprint(1, (debugfile,
  2265. ***************
  2266. *** 622,627 ****
  2267. --- 679,687 ----
  2268.         return(1);
  2269.       }
  2270.   
  2271. +     /* Skip past any existing text */
  2272. +     fseek(edit_fd, 0, SEEK_END);
  2273.       /** is there already text in this file? **/
  2274.   
  2275.       if (fsize(edit_fd) > 0L)
  2276.  
  2277. Index: src/elm.c
  2278. Prereq: 5.14
  2279. *** ../elm2.4/src/elm.c    Mon May 31 15:32:20 1993
  2280. --- src/elm.c    Tue Aug  3 15:29:05 1993
  2281. ***************
  2282. *** 1,8 ****
  2283.   
  2284. ! static char rcsid[] = "@(#)$Id: elm.c,v 5.14 1993/05/31 19:32:20 syd Exp $";
  2285.   
  2286.   /*******************************************************************************
  2287. !  *  The Elm Mail System  -  $Revision: 5.14 $   $State: Exp $
  2288.    *
  2289.    * This file and all associated files and documentation:
  2290.    *            Copyright (c) 1988-1992 USENET Community Trust
  2291. --- 1,8 ----
  2292.   
  2293. ! static char rcsid[] = "@(#)$Id: elm.c,v 5.15 1993/08/03 19:28:39 syd Exp $";
  2294.   
  2295.   /*******************************************************************************
  2296. !  *  The Elm Mail System  -  $Revision: 5.15 $   $State: Exp $
  2297.    *
  2298.    * This file and all associated files and documentation:
  2299.    *            Copyright (c) 1988-1992 USENET Community Trust
  2300. ***************
  2301. *** 15,20 ****
  2302. --- 15,32 ----
  2303.    *
  2304.    *******************************************************************************
  2305.    * $Log: elm.c,v $
  2306. +  * Revision 5.15  1993/08/03  19:28:39  syd
  2307. +  * Elm tries to replace the system toupper() and tolower() on current
  2308. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  2309. +  * collide during linking with routines in isctype.o.  This patch adds
  2310. +  * a Configure test to determine whether replacements are really needed
  2311. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  2312. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  2313. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  2314. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  2315. +  * were dropped.
  2316. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2317. +  *
  2318.    * Revision 5.14  1993/05/31  19:32:20  syd
  2319.    * With this patch build_address() should treat local mailing
  2320.    * lists and other aliases known by the transport agent as valid
  2321. ***************
  2322. *** 103,112 ****
  2323.   #endif
  2324.   #ifdef BSD
  2325.   #  include <sys/timeb.h>
  2326. - #undef        toupper
  2327. - #undef        tolower
  2328.   #endif
  2329.   
  2330.   long bytes();
  2331. --- 115,120 ----
  2332.  
  2333. Index: src/expires.c
  2334. Prereq: 5.2
  2335. *** ../elm2.4/src/expires.c    Sun Dec  6 21:59:02 1992
  2336. --- src/expires.c    Tue Aug 10 14:53:31 1993
  2337. ***************
  2338. *** 1,8 ****
  2339.   
  2340. ! static char rcsid[] = "@(#)$Id: expires.c,v 5.2 1992/12/07 02:58:56 syd Exp $";
  2341.   
  2342.   /*******************************************************************************
  2343. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  2344.    *
  2345.    *            Copyright (c) 1988-1992 USENET Community Trust
  2346.    *            Copyright (c) 1986,1987 Dave Taylor
  2347. --- 1,8 ----
  2348.   
  2349. ! static char rcsid[] = "@(#)$Id: expires.c,v 5.4 1993/08/10 18:53:31 syd Exp $";
  2350.   
  2351.   /*******************************************************************************
  2352. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  2353.    *
  2354.    *            Copyright (c) 1988-1992 USENET Community Trust
  2355.    *            Copyright (c) 1986,1987 Dave Taylor
  2356. ***************
  2357. *** 14,19 ****
  2358. --- 14,36 ----
  2359.    *
  2360.    *******************************************************************************
  2361.    * $Log: expires.c,v $
  2362. +  * Revision 5.4  1993/08/10  18:53:31  syd
  2363. +  * I compiled elm 2.4.22 with Purify 2 and fixed some memory leaks and
  2364. +  * some reads of unitialized memory.
  2365. +  * From: vogt@isa.de
  2366. +  *
  2367. +  * Revision 5.3  1993/08/03  19:28:39  syd
  2368. +  * Elm tries to replace the system toupper() and tolower() on current
  2369. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  2370. +  * collide during linking with routines in isctype.o.  This patch adds
  2371. +  * a Configure test to determine whether replacements are really needed
  2372. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  2373. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  2374. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  2375. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  2376. +  * were dropped.
  2377. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2378. +  *
  2379.    * Revision 5.2  1992/12/07  02:58:56  syd
  2380.    * Fix long -> time_t
  2381.    * From: Syd
  2382. ***************
  2383. *** 39,51 ****
  2384.   #  include <sys/time.h>
  2385.   #endif
  2386.   
  2387. - #include <ctype.h>
  2388. - #ifdef BSD
  2389. - #undef toupper
  2390. - #undef tolower
  2391. - #endif
  2392.   process_expiration_date(date, message_status)
  2393.   char *date;
  2394.   int  *message_status;
  2395. --- 56,61 ----
  2396. ***************
  2397. *** 53,59 ****
  2398.       struct tm *timestruct;
  2399.       time_t thetime;
  2400.       char word1[WLEN], word2[WLEN], word3[WLEN], word4[WLEN], word5[WLEN];
  2401. !     int  month = 0, day = 0, year = 0, hour = 0, minute = 0;
  2402.   #ifndef    _POSIX_SOURCE
  2403.       struct tm *localtime();
  2404.       time_t time();
  2405. --- 63,69 ----
  2406.       struct tm *timestruct;
  2407.       time_t thetime;
  2408.       char word1[WLEN], word2[WLEN], word3[WLEN], word4[WLEN], word5[WLEN];
  2409. !     int  month = 0, day = 0, year = 0, hour = 0, minute = 0, items;
  2410.   #ifndef    _POSIX_SOURCE
  2411.       struct tm *localtime();
  2412.       time_t time();
  2413. ***************
  2414. *** 77,84 ****
  2415.           so is the first field the month or the day?  Standard prob.
  2416.       **/
  2417.   
  2418. !     sscanf(date, "%s %s %s %s %s",
  2419. !         word1, word2, word3, word4, word5);
  2420.   
  2421.       if (strlen(word5) != 0) {    /* we have form #7 */
  2422.         day   = atoi(word1);
  2423. --- 87,105 ----
  2424.           so is the first field the month or the day?  Standard prob.
  2425.       **/
  2426.   
  2427. !     items = sscanf(date, "%s %s %s %s %s",
  2428. !                word1, word2, word3, word4, word5);
  2429. !     if (items < 5)
  2430. !       word5[0] = '\0';
  2431. !     if (items < 4)
  2432. !       word4[0] = '\0';
  2433. !     if (items < 3)
  2434. !       word3[0] = '\0';
  2435. !     if (items < 2)
  2436. !       word2[0] = '\0';
  2437. !     if (items < 1)
  2438. !       word1[0] = '\0';
  2439.   
  2440.       if (strlen(word5) != 0) {    /* we have form #7 */
  2441.         day   = atoi(word1);
  2442.  
  2443. Index: src/file.c
  2444. Prereq: 5.20
  2445. *** ../elm2.4/src/file.c    Thu May 13 23:57:38 1993
  2446. --- src/file.c    Tue Aug  3 15:29:06 1993
  2447. ***************
  2448. *** 1,8 ****
  2449.   
  2450. ! static char rcsid[] = "@(#)$Id: file.c,v 5.20 1993/05/14 03:57:36 syd Exp $";
  2451.   
  2452.   /*******************************************************************************
  2453. !  *  The Elm Mail System  -  $Revision: 5.20 $   $State: Exp $
  2454.    *
  2455.    *            Copyright (c) 1988-1992 USENET Community Trust
  2456.    *            Copyright (c) 1986,1987 Dave Taylor
  2457. --- 1,8 ----
  2458.   
  2459. ! static char rcsid[] = "@(#)$Id: file.c,v 5.21 1993/08/03 19:28:39 syd Exp $";
  2460.   
  2461.   /*******************************************************************************
  2462. !  *  The Elm Mail System  -  $Revision: 5.21 $   $State: Exp $
  2463.    *
  2464.    *            Copyright (c) 1988-1992 USENET Community Trust
  2465.    *            Copyright (c) 1986,1987 Dave Taylor
  2466. ***************
  2467. *** 14,19 ****
  2468. --- 14,31 ----
  2469.    *
  2470.    *******************************************************************************
  2471.    * $Log: file.c,v $
  2472. +  * Revision 5.21  1993/08/03  19:28:39  syd
  2473. +  * Elm tries to replace the system toupper() and tolower() on current
  2474. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  2475. +  * collide during linking with routines in isctype.o.  This patch adds
  2476. +  * a Configure test to determine whether replacements are really needed
  2477. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  2478. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  2479. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  2480. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  2481. +  * were dropped.
  2482. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2483. +  *
  2484.    * Revision 5.20  1993/05/14  03:57:36  syd
  2485.    * A couple of calls to want_to() had typos. Here is the patch.
  2486.    * From: Jukka Ukkonen <ukkonen@csc.fi>
  2487. ***************
  2488. *** 139,151 ****
  2489.   #endif
  2490.   
  2491.   #include "s_elm.h"
  2492. - #include <ctype.h>
  2493.   #include <errno.h>
  2494.   
  2495. - #ifdef BSD
  2496. - #undef tolower
  2497. - #endif
  2498.   extern int errno;
  2499.   
  2500.   char *nameof();
  2501. --- 151,158 ----
  2502.  
  2503. Index: src/file_util.c
  2504. Prereq: 5.6
  2505. *** ../elm2.4/src/file_util.c    Wed Feb  3 14:06:48 1993
  2506. --- src/file_util.c    Sun Aug 22 23:26:49 1993
  2507. ***************
  2508. *** 1,8 ****
  2509.   
  2510. ! static char rcsid[] = "@(#)$Id: file_util.c,v 5.6 1993/02/03 19:06:31 syd Exp $";
  2511.   
  2512.   /*******************************************************************************
  2513. !  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
  2514.    *
  2515.    *            Copyright (c) 1988-1992 USENET Community Trust
  2516.    *            Copyright (c) 1986,1987 Dave Taylor
  2517. --- 1,8 ----
  2518.   
  2519. ! static char rcsid[] = "@(#)$Id: file_util.c,v 5.8 1993/08/23 03:26:24 syd Exp $";
  2520.   
  2521.   /*******************************************************************************
  2522. !  *  The Elm Mail System  -  $Revision: 5.8 $   $State: Exp $
  2523.    *
  2524.    *            Copyright (c) 1988-1992 USENET Community Trust
  2525.    *            Copyright (c) 1986,1987 Dave Taylor
  2526. ***************
  2527. *** 14,19 ****
  2528. --- 14,36 ----
  2529.    *
  2530.    *******************************************************************************
  2531.    * $Log: file_util.c,v $
  2532. +  * Revision 5.8  1993/08/23  03:26:24  syd
  2533. +  * Try setting group id separate from user id in chown to
  2534. +  * allow restricted systems to change group id of file
  2535. +  * From: Syd
  2536. +  *
  2537. +  * Revision 5.7  1993/08/03  19:28:39  syd
  2538. +  * Elm tries to replace the system toupper() and tolower() on current
  2539. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  2540. +  * collide during linking with routines in isctype.o.  This patch adds
  2541. +  * a Configure test to determine whether replacements are really needed
  2542. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  2543. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  2544. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  2545. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  2546. +  * were dropped.
  2547. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2548. +  *
  2549.    * Revision 5.6  1993/02/03  19:06:31  syd
  2550.    * Remove extra strchr/strcat/strcpy et al declarations
  2551.    * From: Syd
  2552. ***************
  2553. *** 49,61 ****
  2554.   #include "headers.h"
  2555.   #include "s_elm.h"
  2556.   #include <sys/stat.h>
  2557. - #include <ctype.h>
  2558. - #include <errno.h>
  2559. - #ifdef BSD
  2560. - # undef tolower
  2561. - #endif
  2562.   #include <errno.h>
  2563.   
  2564.   #ifdef BSD
  2565. --- 66,71 ----
  2566. ***************
  2567. *** 145,151 ****
  2568.         perror(to);
  2569.         return(1);
  2570.       }
  2571. !     chown( to, userid, groupid);
  2572.   
  2573.       return(0);
  2574.   }
  2575. --- 155,162 ----
  2576.         perror(to);
  2577.         return(1);
  2578.       }
  2579. !     chown( to, -1, groupid);
  2580. !     chown( to, userid, -1);    /* at least groupid will change */
  2581.   
  2582.       return(0);
  2583.   }
  2584.  
  2585. Index: src/fileio.c
  2586. Prereq: 5.8
  2587. *** ../elm2.4/src/fileio.c    Mon Feb  8 13:38:12 1993
  2588. --- src/fileio.c    Mon Aug 23 08:28:44 1993
  2589. ***************
  2590. *** 1,8 ****
  2591.   
  2592. ! static char rcsid[] = "@(#)$Id: fileio.c,v 5.8 1993/02/08 18:38:12 syd Exp $";
  2593.   
  2594.   /*******************************************************************************
  2595. !  *  The Elm Mail System  -  $Revision: 5.8 $   $State: Exp $
  2596.    *
  2597.    *            Copyright (c) 1988-1992 USENET Community Trust
  2598.    *            Copyright (c) 1986,1987 Dave Taylor
  2599. --- 1,8 ----
  2600.   
  2601. ! static char rcsid[] = "@(#)$Id: fileio.c,v 5.12 1993/08/23 12:28:23 syd Exp $";
  2602.   
  2603.   /*******************************************************************************
  2604. !  *  The Elm Mail System  -  $Revision: 5.12 $   $State: Exp $
  2605.    *
  2606.    *            Copyright (c) 1988-1992 USENET Community Trust
  2607.    *            Copyright (c) 1986,1987 Dave Taylor
  2608. ***************
  2609. *** 14,19 ****
  2610. --- 14,44 ----
  2611.    *
  2612.    *******************************************************************************
  2613.    * $Log: fileio.c,v $
  2614. +  * Revision 5.12  1993/08/23  12:28:23  syd
  2615. +  * Fix placement of ifdef for PC_CHOWN
  2616. +  * From: syd
  2617. +  *
  2618. +  * Revision 5.11  1993/08/23  03:26:24  syd
  2619. +  * Try setting group id separate from user id in chown to
  2620. +  * allow restricted systems to change group id of file
  2621. +  * From: Syd
  2622. +  *
  2623. +  * Revision 5.10  1993/08/10  20:29:52  syd
  2624. +  * add PC_CHOWN_RESTRICTED where needed
  2625. +  * From: Syd
  2626. +  *
  2627. +  * Revision 5.9  1993/08/03  19:28:39  syd
  2628. +  * Elm tries to replace the system toupper() and tolower() on current
  2629. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  2630. +  * collide during linking with routines in isctype.o.  This patch adds
  2631. +  * a Configure test to determine whether replacements are really needed
  2632. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  2633. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  2634. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  2635. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  2636. +  * were dropped.
  2637. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2638. +  *
  2639.    * Revision 5.8  1993/02/08  18:38:12  syd
  2640.    * Fix to copy_file to ignore unescaped from if content_length not yet reached.
  2641.    * Fixes to NLS messages match number of newlines between default messages
  2642. ***************
  2643. *** 60,72 ****
  2644.   #include "headers.h"
  2645.   #include "s_elm.h"
  2646.   #include <sys/stat.h>
  2647. - #include <ctype.h>
  2648.   #include <errno.h>
  2649.   
  2650. - #ifdef BSD
  2651. - #undef tolower
  2652. - #endif
  2653.   extern int errno;
  2654.   
  2655.   char *error_description();
  2656. --- 85,92 ----
  2657. ***************
  2658. *** 427,440 ****
  2659.       /*
  2660.        * Chown is restricted to root on BSD unix
  2661.        */
  2662. !     (void) chown(fname, new_owner, new_group);
  2663.   #else
  2664. !     if((i = chown(fname, new_owner, new_group)) == -1)
  2665. !       ret_code = -1;
  2666. !     dprint(2, (debugfile, "** chown(%s, %d, %d) returns %d [errno=%d] **\n",
  2667. !            fname, new_owner, new_group, i, errno));
  2668. ! #endif
  2669.   
  2670.       return(ret_code);
  2671.   
  2672. --- 447,475 ----
  2673.       /*
  2674.        * Chown is restricted to root on BSD unix
  2675.        */
  2676. !     (void) chown(fname, -1, new_group);
  2677. !     (void) chown(fname, new_owner, -1);
  2678.   #else
  2679. ! #  ifdef _PC_CHOWN_RESTRICTED
  2680. ! /*
  2681. !  * Chown may or may not be restricted to root in SVR4, if it is,
  2682. !  *    then need to copy must be true, and no restore of permissions
  2683. !  *    should be performed.
  2684. !  */
  2685. !         if (!pathconf(fname, _PC_CHOWN_RESTRICTED)) {
  2686. ! #  endif
  2687. !         if((i = chown(fname, new_owner, new_group)) == -1)
  2688. !         ret_code = -1;
  2689. !         dprint(2, (debugfile, "** chown(%s, %d, %d) returns %d [errno=%d] **\n",
  2690. !                fname, new_owner, new_group, i, errno));
  2691. ! #  ifdef _PC_CHOWN_RESTRICTED
  2692. !     } else {
  2693. !         (void) chown(fname, -1, new_group);
  2694. !         (void) chown(fname, new_owner, -1);
  2695. !     }
  2696. ! #  endif /* _PC_CHOWN_RESTRICTED */
  2697. ! #endif /* BSD */
  2698.   
  2699.       return(ret_code);
  2700.   
  2701.  
  2702. Index: src/forms.c
  2703. Prereq: 5.3
  2704. *** ../elm2.4/src/forms.c    Wed Feb  3 14:06:48 1993
  2705. --- src/forms.c    Tue Aug  3 15:10:22 1993
  2706. ***************
  2707. *** 1,8 ****
  2708.   
  2709. ! static char rcsid[] = "@(#)$Id: forms.c,v 5.3 1993/02/03 19:06:31 syd Exp $";
  2710.   
  2711.   /*******************************************************************************
  2712. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  2713.    *
  2714.    *            Copyright (c) 1988-1992 USENET Community Trust
  2715.    *            Copyright (c) 1986,1987 Dave Taylor
  2716. --- 1,8 ----
  2717.   
  2718. ! static char rcsid[] = "@(#)$Id: forms.c,v 5.4 1993/08/03 19:10:22 syd Exp $";
  2719.   
  2720.   /*******************************************************************************
  2721. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  2722.    *
  2723.    *            Copyright (c) 1988-1992 USENET Community Trust
  2724.    *            Copyright (c) 1986,1987 Dave Taylor
  2725. ***************
  2726. *** 14,19 ****
  2727. --- 14,24 ----
  2728.    *
  2729.    *******************************************************************************
  2730.    * $Log: forms.c,v $
  2731. +  * Revision 5.4  1993/08/03  19:10:22  syd
  2732. +  * The last character of a form field gets zapped if more characters than
  2733. +  * the field expects are entered.
  2734. +  * From: dwolfe@pffft.sps.mot.com (Dave Wolfe)
  2735. +  *
  2736.    * Revision 5.3  1993/02/03  19:06:31  syd
  2737.    * Remove extra strchr/strcat/strcpy et al declarations
  2738.    * From: Syd
  2739. ***************
  2740. *** 399,403 ****
  2741.       fgets(buffer, SLEN, stdin);
  2742.       no_ret(buffer);
  2743.   
  2744. !     if (strlen(buffer) > field_size) buffer[field_size-1] = '\0';
  2745.   }
  2746. --- 404,408 ----
  2747.       fgets(buffer, SLEN, stdin);
  2748.       no_ret(buffer);
  2749.   
  2750. !     if (strlen(buffer) > field_size) buffer[field_size] = '\0';
  2751.   }
  2752.  
  2753. Index: src/hdrconfg.c
  2754. Prereq: 5.2
  2755. *** ../elm2.4/src/hdrconfg.c    Sat Nov 21 20:15:16 1992
  2756. --- src/hdrconfg.c    Tue Aug  3 15:29:09 1993
  2757. ***************
  2758. *** 1,8 ****
  2759.   
  2760. ! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 5.2 1992/11/22 01:15:15 syd Exp $";
  2761.   
  2762.   /*******************************************************************************
  2763. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  2764.    *
  2765.    *            Copyright (c) 1988-1992 USENET Community Trust
  2766.    *            Copyright (c) 1986,1987 Dave Taylor
  2767. --- 1,8 ----
  2768.   
  2769. ! static char rcsid[] = "@(#)$Id: hdrconfg.c,v 5.3 1993/08/03 19:28:39 syd Exp $";
  2770.   
  2771.   /*******************************************************************************
  2772. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  2773.    *
  2774.    *            Copyright (c) 1988-1992 USENET Community Trust
  2775.    *            Copyright (c) 1986,1987 Dave Taylor
  2776. ***************
  2777. *** 14,19 ****
  2778. --- 14,31 ----
  2779.    *
  2780.    *******************************************************************************
  2781.    * $Log: hdrconfg.c,v $
  2782. +  * Revision 5.3  1993/08/03  19:28:39  syd
  2783. +  * Elm tries to replace the system toupper() and tolower() on current
  2784. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  2785. +  * collide during linking with routines in isctype.o.  This patch adds
  2786. +  * a Configure test to determine whether replacements are really needed
  2787. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  2788. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  2789. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  2790. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  2791. +  * were dropped.
  2792. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2793. +  *
  2794.    * Revision 5.2  1992/11/22  01:15:15  syd
  2795.    * Add on initial display or display where the entire screen is being
  2796.    * drawn, we should not output the trailing blanks that clear the old
  2797. ***************
  2798. *** 47,59 ****
  2799.   #include "headers.h"
  2800.   #include "s_elm.h"
  2801.   
  2802. - #include <ctype.h>
  2803. - #ifdef BSD
  2804. - #undef toupper
  2805. - #undef tolower
  2806. - #endif
  2807.   /*
  2808.    * Placement of prompts and messages at the bottom of the screen.
  2809.    */
  2810. --- 59,64 ----
  2811. ***************
  2812. *** 572,578 ****
  2813.   
  2814.       c = getchar();
  2815.   
  2816. !     switch ((int)(isupper(c) ? tolower(c) : c)) {
  2817.       case 't':
  2818.           h = &hmenu_to;
  2819.           break;
  2820. --- 577,583 ----
  2821.   
  2822.       c = getchar();
  2823.   
  2824. !     switch (tolower(c)) {
  2825.       case 't':
  2826.           h = &hmenu_to;
  2827.           break;
  2828.  
  2829. Index: src/help.c
  2830. Prereq: 5.3
  2831. *** ../elm2.4/src/help.c    Sun Apr 11 23:15:49 1993
  2832. --- src/help.c    Tue Aug  3 15:29:09 1993
  2833. ***************
  2834. *** 1,8 ****
  2835.   
  2836. ! static char rcsid[] = "@(#)$Id: help.c,v 5.3 1993/04/12 03:15:41 syd Exp $";
  2837.   
  2838.   /*******************************************************************************
  2839. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  2840.    *
  2841.    *            Copyright (c) 1988-1992 USENET Community Trust
  2842.    *            Copyright (c) 1986,1987 Dave Taylor
  2843. --- 1,8 ----
  2844.   
  2845. ! static char rcsid[] = "@(#)$Id: help.c,v 5.4 1993/08/03 19:28:39 syd Exp $";
  2846.   
  2847.   /*******************************************************************************
  2848. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  2849.    *
  2850.    *            Copyright (c) 1988-1992 USENET Community Trust
  2851.    *            Copyright (c) 1986,1987 Dave Taylor
  2852. ***************
  2853. *** 14,19 ****
  2854. --- 14,31 ----
  2855.    *
  2856.    *******************************************************************************
  2857.    * $Log: help.c,v $
  2858. +  * Revision 5.4  1993/08/03  19:28:39  syd
  2859. +  * Elm tries to replace the system toupper() and tolower() on current
  2860. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  2861. +  * collide during linking with routines in isctype.o.  This patch adds
  2862. +  * a Configure test to determine whether replacements are really needed
  2863. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  2864. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  2865. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  2866. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  2867. +  * were dropped.
  2868. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2869. +  *
  2870.    * Revision 5.3  1993/04/12  03:15:41  syd
  2871.    * These patches makes 'T' (since it was free) do a Tag and Move command in the
  2872.    * index and alias page, and in the builtin pager.
  2873. ***************
  2874. *** 35,41 ****
  2875.   
  2876.   ***/
  2877.   
  2878. - #include <ctype.h>
  2879.   #include "headers.h"
  2880.   #include "s_elm.h"
  2881.   
  2882. --- 47,52 ----
  2883.  
  2884. Index: src/in_utils.c
  2885. Prereq: 5.11
  2886. *** ../elm2.4/src/in_utils.c    Sun May 16 16:56:19 1993
  2887. --- src/in_utils.c    Tue Aug  3 15:29:10 1993
  2888. ***************
  2889. *** 1,8 ****
  2890.   
  2891. ! static char rcsid[] = "@(#)$Id: in_utils.c,v 5.11 1993/05/16 20:56:18 syd Exp $";
  2892.   
  2893.   /*******************************************************************************
  2894. !  *  The Elm Mail System  -  $Revision: 5.11 $   $State: Exp $
  2895.    *
  2896.    *            Copyright (c) 1988-1992 USENET Community Trust
  2897.    *            Copyright (c) 1986,1987 Dave Taylor
  2898. --- 1,8 ----
  2899.   
  2900. ! static char rcsid[] = "@(#)$Id: in_utils.c,v 5.13 1993/08/03 19:28:39 syd Exp $";
  2901.   
  2902.   /*******************************************************************************
  2903. !  *  The Elm Mail System  -  $Revision: 5.13 $   $State: Exp $
  2904.    *
  2905.    *            Copyright (c) 1988-1992 USENET Community Trust
  2906.    *            Copyright (c) 1986,1987 Dave Taylor
  2907. ***************
  2908. *** 14,19 ****
  2909. --- 14,38 ----
  2910.    *
  2911.    *******************************************************************************
  2912.    * $Log: in_utils.c,v $
  2913. +  * Revision 5.13  1993/08/03  19:28:39  syd
  2914. +  * Elm tries to replace the system toupper() and tolower() on current
  2915. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  2916. +  * collide during linking with routines in isctype.o.  This patch adds
  2917. +  * a Configure test to determine whether replacements are really needed
  2918. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  2919. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  2920. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  2921. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  2922. +  * were dropped.
  2923. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2924. +  *
  2925. +  * Revision 5.12  1993/08/03  19:10:50  syd
  2926. +  * Patch for Elm 2.4 PL22 to correct handling of SIGWINCH signals on
  2927. +  * DecStations with Ultrix 4.2.
  2928. +  * The problem was that elm running in an xterm exits silently when the
  2929. +  * window is resize. This was caused by incorrect signal handling for BSD.
  2930. +  * From: vogt@isa.de
  2931. +  *
  2932.    * Revision 5.11  1993/05/16  20:56:18  syd
  2933.    * fix want-to patch collision
  2934.    * From: Jukka Ukkonen <ukkonen@csc.fi>
  2935. ***************
  2936. *** 84,94 ****
  2937.   #include "headers.h"
  2938.   #include "s_elm.h"
  2939.   #include <errno.h>
  2940. - #include <ctype.h>
  2941. - #ifdef BSD
  2942. - #  undef tolower
  2943. - #endif
  2944.   
  2945.   extern int errno;        /* system error number */
  2946.   
  2947. --- 103,108 ----
  2948. ***************
  2949. *** 572,579 ****
  2950.           alarm((unsigned) 0);
  2951.         }
  2952.       }
  2953. !     else
  2954. !       ch = ReadCh();
  2955.   #else
  2956.           errno = 0;    /* we actually have to do this.  *sigh*  */
  2957.           ch = ReadCh();
  2958. --- 586,595 ----
  2959.           alarm((unsigned) 0);
  2960.         }
  2961.       }
  2962. !     else {
  2963. !         ch = ReadCh();
  2964. !         if (errno == EINTR) ch = NO_OP_COMMAND;
  2965. !     }
  2966.   #else
  2967.           errno = 0;    /* we actually have to do this.  *sigh*  */
  2968.           ch = ReadCh();
  2969.  
  2970. Index: src/init.c
  2971. Prereq: 5.16
  2972. *** ../elm2.4/src/init.c    Sun Apr 11 23:30:24 1993
  2973. --- src/init.c    Sun Aug 22 23:26:51 1993
  2974. ***************
  2975. *** 1,8 ****
  2976.   
  2977. ! static char rcsid[] = "@(#)$Id: init.c,v 5.16 1993/04/12 03:30:23 syd Exp $";
  2978.   
  2979.   /*******************************************************************************
  2980. !  *  The Elm Mail System  -  $Revision: 5.16 $   $State: Exp $
  2981.    *
  2982.    *            Copyright (c) 1988-1992 USENET Community Trust
  2983.    *            Copyright (c) 1986,1987 Dave Taylor
  2984. --- 1,8 ----
  2985.   
  2986. ! static char rcsid[] = "@(#)$Id: init.c,v 5.18 1993/08/23 03:26:24 syd Exp $";
  2987.   
  2988.   /*******************************************************************************
  2989. !  *  The Elm Mail System  -  $Revision: 5.18 $   $State: Exp $
  2990.    *
  2991.    *            Copyright (c) 1988-1992 USENET Community Trust
  2992.    *            Copyright (c) 1986,1987 Dave Taylor
  2993. ***************
  2994. *** 14,19 ****
  2995. --- 14,36 ----
  2996.    *
  2997.    *******************************************************************************
  2998.    * $Log: init.c,v $
  2999. +  * Revision 5.18  1993/08/23  03:26:24  syd
  3000. +  * Try setting group id separate from user id in chown to
  3001. +  * allow restricted systems to change group id of file
  3002. +  * From: Syd
  3003. +  *
  3004. +  * Revision 5.17  1993/08/03  19:28:39  syd
  3005. +  * Elm tries to replace the system toupper() and tolower() on current
  3006. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  3007. +  * collide during linking with routines in isctype.o.  This patch adds
  3008. +  * a Configure test to determine whether replacements are really needed
  3009. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  3010. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  3011. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  3012. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  3013. +  * were dropped.
  3014. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  3015. +  *
  3016.    * Revision 5.16  1993/04/12  03:30:23  syd
  3017.    * On AIX, __STDC__ is not defined but it does use unistd.h, etc.  In
  3018.    * hdrs/def.h, ANS_C already gets defined if __STDC__ or _AIX.  But this
  3019. ***************
  3020. *** 128,141 ****
  3021.   #  include <sys/time.h>
  3022.   #endif
  3023.   
  3024. - #include <ctype.h>
  3025.   #include <errno.h>
  3026.   
  3027. - #ifdef BSD
  3028. - #undef toupper
  3029. - #undef tolower
  3030. - #endif
  3031.   extern int errno;        /* system error number on failure */
  3032.   extern char version_buff[];
  3033.   
  3034. --- 145,152 ----
  3035. ***************
  3036. *** 273,279 ****
  3037.               "Could not open file %s for debug output!\n"),
  3038.             filename));
  3039.         }
  3040. !       chown(filename, userid, groupid); /* file owned by user */
  3041.   
  3042.         fprintf(debugfile, 
  3043.        "Debug output of the ELM program (at debug level %d).  Version %s\n\n",
  3044. --- 284,291 ----
  3045.               "Could not open file %s for debug output!\n"),
  3046.             filename));
  3047.         }
  3048. !       chown(filename, -1, groupid); /* file owned by user */
  3049. !       chown(filename, userid, -1); /* at least groupid should change */
  3050.   
  3051.         fprintf(debugfile, 
  3052.        "Debug output of the ELM program (at debug level %d).  Version %s\n\n",
  3053.  
  3054. Index: src/leavembox.c
  3055. Prereq: 5.17
  3056. *** ../elm2.4/src/leavembox.c    Mon May 31 15:47:59 1993
  3057. --- src/leavembox.c    Sun Aug 22 23:26:52 1993
  3058. ***************
  3059. *** 1,8 ****
  3060.   
  3061. ! static char rcsid[] = "@(#)$Id: leavembox.c,v 5.17 1993/05/31 19:47:45 syd Exp $";
  3062.   
  3063.   /*******************************************************************************
  3064. !  *  The Elm Mail System  -  $Revision: 5.17 $   $State: Exp $
  3065.    *
  3066.    *            Copyright (c) 1988-1992 USENET Community Trust
  3067.    *            Copyright (c) 1986,1987 Dave Taylor
  3068. --- 1,8 ----
  3069.   
  3070. ! static char rcsid[] = "@(#)$Id: leavembox.c,v 5.19 1993/08/23 03:26:24 syd Exp $";
  3071.   
  3072.   /*******************************************************************************
  3073. !  *  The Elm Mail System  -  $Revision: 5.19 $   $State: Exp $
  3074.    *
  3075.    *            Copyright (c) 1988-1992 USENET Community Trust
  3076.    *            Copyright (c) 1986,1987 Dave Taylor
  3077. ***************
  3078. *** 14,19 ****
  3079. --- 14,29 ----
  3080.    *
  3081.    *******************************************************************************
  3082.    * $Log: leavembox.c,v $
  3083. +  * Revision 5.19  1993/08/23  03:26:24  syd
  3084. +  * Try setting group id separate from user id in chown to
  3085. +  * allow restricted systems to change group id of file
  3086. +  * From: Syd
  3087. +  *
  3088. +  * Revision 5.18  1993/08/03  19:59:49  syd
  3089. +  * Check for chown restricted and if so, do copyover and
  3090. +  * back to avoid need for chown
  3091. +  * From: Syd
  3092. +  *
  3093.    * Revision 5.17  1993/05/31  19:47:45  syd
  3094.    * change is_symlink to no_restore and use it for special modes as well
  3095.    * From: Syd
  3096. ***************
  3097. *** 542,548 ****
  3098.         }
  3099.         fclose(temp);
  3100.         dprint(2, (debugfile, "\n\n"));
  3101. !       chown(recvd_mail, userid, groupid);
  3102.       }
  3103.   
  3104.       /* If there are any messages to keep, first copy them to a
  3105. --- 552,559 ----
  3106.         }
  3107.         fclose(temp);
  3108.         dprint(2, (debugfile, "\n\n"));
  3109. !       chown(recvd_mail, -1, groupid);
  3110. !       chown(recvd_mail, userid, -1);
  3111.       }
  3112.   
  3113.       /* If there are any messages to keep, first copy them to a
  3114. ***************
  3115. *** 689,694 ****
  3116. --- 700,719 ----
  3117.         }
  3118.   #endif
  3119.   
  3120. + #ifdef _PC_CHOWN_RESTRICTED
  3121. +       if (!need_to_copy) {
  3122. + /*
  3123. +  * Chown may or may not be restricted to root in SVR4, if it is,
  3124. +  *    then need to copy must be true, and no restore of permissions
  3125. +  *    should be performed.
  3126. +  */
  3127. +           if (pathconf(cur_folder, _PC_CHOWN_RESTRICTED)) {
  3128. +          need_to_copy = TRUE;
  3129. +          no_restore = TRUE;
  3130. +           }
  3131. +       }
  3132. + #endif  /* _PC_CHOWN_RESTRICTED */
  3133.   #ifdef SAVE_GROUP_MAILBOX_ID
  3134.         if (folder_type == SPOOL)
  3135.                 setgid(mailgroupid);
  3136.  
  3137.